From da1dc90f9252fca27b5735289eb5a4a19efacbf2 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 17 Feb 2015 16:17:06 -0500 Subject: [PATCH] Bug 1133201 - part 2 - don't send referrer information when opening new windows via context menu; r=Gijs,mconley Part 1 fixed sending referrer information when opening a plain text "link" in a new tab through the context menu. This patch fixes the same problem, but for the case of opening in a new window, since we take slightly different paths through |openLinkIn| for tabs vs. windows. --- browser/base/content/content.js | 2 +- browser/base/content/utilityOverlay.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/base/content/content.js b/browser/base/content/content.js index b4c78fe6791..6cbd3f8beab 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -672,8 +672,8 @@ let ClickEventHandler = { event.preventDefault(); // Need to prevent the pageload. } } - json.noReferrer = BrowserUtils.linkHasNoReferrer(node) } + json.noReferrer = BrowserUtils.linkHasNoReferrer(node) sendAsyncMessage("Content:Click", json); return; diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index f2a51a55118..392bcb0b874 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -231,7 +231,7 @@ function openLinkIn(url, where, params) { "where == 'save' but without initiatingDoc. See bug 814264."); return; } - saveURL(url, null, null, true, null, aReferrerURI, aInitiatingDoc); + saveURL(url, null, null, true, null, aNoReferrer ? null : aReferrerURI, aInitiatingDoc); return; } const Cc = Components.classes; @@ -265,7 +265,7 @@ function openLinkIn(url, where, params) { sa.AppendElement(wuri); sa.AppendElement(charset); - sa.AppendElement(aReferrerURI); + sa.AppendElement(aNoReferrer ? null : aReferrerURI); sa.AppendElement(aPostData); sa.AppendElement(allowThirdPartyFixupSupports); @@ -327,7 +327,7 @@ function openLinkIn(url, where, params) { if (aDisallowInheritPrincipal && !(uriObj && uriObj.schemeIs("javascript"))) flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER; - w.gBrowser.loadURIWithFlags(url, flags, aReferrerURI, null, aPostData); + w.gBrowser.loadURIWithFlags(url, flags, aNoReferrer ? null : aReferrerURI, null, aPostData); break; case "tabshifted": loadInBackground = !loadInBackground;