From 1863ea36b1bb485ac4a2f101f7108cd8560b883d Mon Sep 17 00:00:00 2001 From: "db48x%yahoo.com" Date: Wed, 23 Mar 2005 21:37:44 +0000 Subject: [PATCH] bug 239472: Page Info -> media -> Save As... doesn't work r=db48x, sr=jag git-svn-id: svn://10.0.0.236/trunk@171120 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/content/contentAreaUtils.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mozilla/toolkit/content/contentAreaUtils.js b/mozilla/toolkit/content/contentAreaUtils.js index 46c9d032e96..9ac3264983a 100644 --- a/mozilla/toolkit/content/contentAreaUtils.js +++ b/mozilla/toolkit/content/contentAreaUtils.js @@ -155,9 +155,9 @@ const kSaveAsType_Text = 2; // Save document, converting to plain text. // - A linked document using Save Link As... // - A linked document using Alt-click Save Link As... // -function saveURL(aURL, aFileName, aFilePickerTitleKey, aShouldBypassCache, aSkipPrompt) +function saveURL(aURL, aFileName, aFilePickerTitleKey, aShouldBypassCache, aSkipPrompt, aReferrer) { - saveInternal(aURL, null, aFileName, aFilePickerTitleKey, aShouldBypassCache, aSkipPrompt); + saveInternal(aURL, null, aFileName, aFilePickerTitleKey, aShouldBypassCache, aSkipPrompt, aReferrer); } function saveDocument(aDocument, aSkipPrompt) @@ -172,7 +172,8 @@ function saveDocument(aDocument, aSkipPrompt) function saveInternal(aURL, aDocument, aFileName, aFilePickerTitleKey, - aShouldBypassCache, aSkipPrompt) + aShouldBypassCache, aSkipPrompt, + aReferrer) { if (aSkipPrompt == undefined) aSkipPrompt = false; @@ -183,7 +184,8 @@ function saveInternal(aURL, aDocument, filePickerTitle: aFilePickerTitleKey, document: aDocument, bypassCache: aShouldBypassCache, - window: window + window: window, + referrer: aReferrer }; var sniffer = new nsHeaderSniffer(aURL, foundHeaderInfo, data, aSkipPrompt); } @@ -292,7 +294,8 @@ function foundHeaderInfo(aSniffer, aData, aSkipPrompt) persistArgs.contentType, encodingFlags, kWrapColumn); } else { dl.init(source, persistArgs.target, null, null, null, persist); - persist.saveURI(source, null, getReferrer(document), persistArgs.postData, null, persistArgs.target); + var referrer = aData.referrer || getReferrer(document) + persist.saveURI(source, null, referrer, persistArgs.postData, null, persistArgs.target); } }