Backed out changeset ce050fe2bd45 (bug 1527287) for causing merge conflicts. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Thu, 25 Apr 2019 01:39:26 +0300
changeset 530032 4e178b42acbf9784e1c19e81e998eff32fde578d
parent 530031 dc42ae4e7a3a98147cee86a53923bfffdf77e1de
child 530033 d428c2d08e38eb7a05a25e0c603c90745e1427cb
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1527287
milestone68.0a1
backs outce050fe2bd45de0a82198ef8e0583bc00f0f4280
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset ce050fe2bd45 (bug 1527287) for causing merge conflicts. CLOSED TREE
browser/base/content/browser.js
devtools/client/responsive.html/browser/tunnel.js
dom/base/nsGlobalWindowOuter.cpp
dom/browser-element/BrowserElementParent.cpp
dom/browser-element/BrowserElementParent.h
dom/clients/manager/ClientOpenWindowUtils.cpp
dom/interfaces/base/nsIBrowserDOMWindow.idl
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/PBrowser.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/tests/browser/browser_noopener.js
dom/webidl/BrowserElementDictionaries.webidl
mobile/android/chrome/content/browser.js
modules/libpref/init/StaticPrefList.h
testing/web-platform/meta/html/browsers/the-window-object/window-open-noreferrer.html.ini
toolkit/components/windowcreator/nsIWindowProvider.idl
toolkit/components/windowwatcher/nsPIWindowWatcher.idl
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/components/windowwatcher/nsWindowWatcher.h
xpfe/appshell/nsContentTreeOwner.cpp
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5744,23 +5744,18 @@ nsBrowserAccess.prototype = {
     if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW) {
       if (isExternal &&
           Services.prefs.prefHasUserValue("browser.link.open_newwindow.override.external"))
         aWhere = Services.prefs.getIntPref("browser.link.open_newwindow.override.external");
       else
         aWhere = Services.prefs.getIntPref("browser.link.open_newwindow");
     }
 
-    let referrerInfo;
-    if (aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_REFERRER) {
-      referrerInfo = new ReferrerInfo(Ci.nsIHttpChannel.REFERRER_POLICY_UNSET, false, null);
-    } else {
-      referrerInfo = new ReferrerInfo(Ci.nsIHttpChannel.REFERRER_POLICY_UNSET, true,
-        aOpener ? makeURI(aOpener.location.href) : null);
-    }
+    let referrerInfo = new ReferrerInfo(Ci.nsIHttpChannel.REFERRER_POLICY_UNSET, true,
+      aOpener ? makeURI(aOpener.location.href) : null);
     if (aOpener && aOpener.document) {
       referrerInfo.referrerPolicy = aOpener.document.referrerPolicy;
     }
     let isPrivate = aOpener
                   ? PrivateBrowsingUtils.isContentWindowPrivate(aOpener)
                   : PrivateBrowsingUtils.isWindowPrivate(window);
 
     switch (aWhere) {
--- a/devtools/client/responsive.html/browser/tunnel.js
+++ b/devtools/client/responsive.html/browser/tunnel.js
@@ -258,26 +258,23 @@ function tunnelToInnerBrowser(outer, inn
       //   * Specific target names (everything treated as _blank)
       //   * Window features
       //   * window.opener
       // These things are deferred for now, since content which does depend on them seems
       // outside the main focus of RDM.
       const { detail } = event;
       event.preventDefault();
       const uri = Services.io.newURI(detail.url);
-      let flags = Ci.nsIBrowserDOMWindow.OPEN_NEWTAB;
-      if (detail.forceNoReferrer) {
-        flags |= Ci.nsIBrowserDOMWindow.OPEN_NO_REFERRER;
-      }
       // This API is used mainly because it's near the path used for <a target/> with
       // regular browser tabs (which calls `openURIInFrame`).  The more elaborate APIs
       // that support openers, window features, etc. didn't seem callable from JS and / or
       // this event doesn't give enough info to use them.
       browserWindow.browserDOMWindow
-        .openURI(uri, null, flags, Ci.nsIBrowserDOMWindow.OPEN_NEW,
+        .openURI(uri, null, Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
+                 Ci.nsIBrowserDOMWindow.OPEN_NEW,
                  outer.contentPrincipal);
     },
 
     handleModalPromptEvent({ detail }) {
       // Relay window.alert(), window.prompt() and window.confirm() dialogs through the
       // outer window and make sure the return value is passed back to the inner window.
       // When this event handler is called, the inner iframe is spinning in a nested event
       // loop waiting to be unblocked.
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -7065,34 +7065,26 @@ nsresult nsGlobalWindowOuter::OpenIntern
     // -- see nsIWindowWatcher.idl
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   NS_ASSERTION(mDocShell, "Must have docshell here");
 
   nsAutoCString options;
   bool forceNoOpener = aForceNoOpener;
-  bool forceNoReferrer = false;
   // Unlike other window flags, "noopener" comes from splitting on commas with
   // HTML whitespace trimming...
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tok(
       aOptions, ',');
   while (tok.hasMoreTokens()) {
     auto nextTok = tok.nextToken();
     if (nextTok.EqualsLiteral("noopener")) {
       forceNoOpener = true;
       continue;
     }
-    if (StaticPrefs::dom_window_open_noreferrer_enabled() &&
-        nextTok.LowerCaseEqualsLiteral("noreferrer")) {
-      forceNoReferrer = true;
-      // noreferrer implies noopener
-      forceNoOpener = true;
-      continue;
-    }
     // Want to create a copy of the options without 'noopener' because having
     // 'noopener' in the options affects other window features.
     if (!options.IsEmpty()) {
       options.Append(',');
     }
     AppendUTF16toUTF8(nextTok, options);
   }
 
@@ -7188,17 +7180,17 @@ nsresult nsGlobalWindowOuter::OpenIntern
     nsAutoPopupStatePusher popupStatePusher(PopupBlocker::openAbused, true);
 
     if (!aCalledNoScript) {
       // We asserted at the top of this function that aNavigate is true for
       // !aCalledNoScript.
       rv = pwwatch->OpenWindow2(
           this, url.IsVoid() ? nullptr : url.get(), name_ptr, options_ptr,
           /* aCalledFromScript = */ true, aDialog, aNavigate, argv,
-          isPopupSpamWindow, forceNoOpener, forceNoReferrer, aLoadState,
+          isPopupSpamWindow, forceNoOpener, aLoadState,
           getter_AddRefs(domReturn));
     } else {
       // Force a system caller here so that the window watcher won't screw us
       // up.  We do NOT want this case looking at the JS context on the stack
       // when searching.  Compare comments on
       // nsIDOMWindow::OpenWindow and nsIWindowWatcher::OpenWindow.
 
       // Note: Because nsWindowWatcher is so broken, it's actually important
@@ -7208,17 +7200,17 @@ nsresult nsGlobalWindowOuter::OpenIntern
       Maybe<AutoNoJSAPI> nojsapi;
       if (!aContentModal) {
         nojsapi.emplace();
       }
 
       rv = pwwatch->OpenWindow2(
           this, url.IsVoid() ? nullptr : url.get(), name_ptr, options_ptr,
           /* aCalledFromScript = */ false, aDialog, aNavigate, aExtraArgument,
-          isPopupSpamWindow, forceNoOpener, forceNoReferrer, aLoadState,
+          isPopupSpamWindow, forceNoOpener, aLoadState,
           getter_AddRefs(domReturn));
     }
   }
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   // success!
 
--- a/dom/browser-element/BrowserElementParent.cpp
+++ b/dom/browser-element/BrowserElementParent.cpp
@@ -109,34 +109,32 @@ namespace mozilla {
  * was accepted by the embedder.
  */
 /*static*/
 BrowserElementParent::OpenWindowResult
 BrowserElementParent::DispatchOpenWindowEvent(Element* aOpenerFrameElement,
                                               Element* aPopupFrameElement,
                                               const nsAString& aURL,
                                               const nsAString& aName,
-                                              bool aForceNoReferrer,
                                               const nsAString& aFeatures) {
   // Dispatch a CustomEvent at aOpenerFrameElement with a detail object
   // (OpenWindowEventDetail) containing aPopupFrameElement, aURL, aName, and
   // aFeatures.
 
   // Create the event's detail object.
   OpenWindowEventDetail detail;
   if (aURL.IsEmpty()) {
     // URL should never be empty. Assign about:blank as default.
     detail.mUrl = NS_LITERAL_STRING("about:blank");
   } else {
     detail.mUrl = aURL;
   }
   detail.mName = aName;
   detail.mFeatures = aFeatures;
   detail.mFrameElement = aPopupFrameElement;
-  detail.mForceNoReferrer = aForceNoReferrer;
 
   nsIGlobalObject* sgo = aPopupFrameElement->OwnerDoc()->GetScopeObject();
   if (!sgo) {
     return BrowserElementParent::OPEN_WINDOW_IGNORED;
   }
 
   AutoJSAPI jsapi;
   if (!jsapi.Init(sgo)) {
@@ -170,18 +168,17 @@ BrowserElementParent::DispatchOpenWindow
   }
 
   return BrowserElementParent::OPEN_WINDOW_IGNORED;
 }
 
 /*static*/
 BrowserElementParent::OpenWindowResult BrowserElementParent::OpenWindowOOP(
     TabParent* aOpenerTabParent, TabParent* aPopupTabParent,
-    const nsAString& aURL, const nsAString& aName, bool aForceNoReferrer,
-    const nsAString& aFeatures) {
+    const nsAString& aURL, const nsAString& aName, const nsAString& aFeatures) {
   // Create an iframe owned by the same document which owns openerFrameElement.
   nsCOMPtr<Element> openerFrameElement = aOpenerTabParent->GetOwnerElement();
   NS_ENSURE_TRUE(openerFrameElement, BrowserElementParent::OPEN_WINDOW_IGNORED);
   RefPtr<HTMLIFrameElement> popupFrameElement =
       CreateIframe(openerFrameElement, aName, /* aRemote = */ true);
 
   // Normally an <iframe> element will try to create a frameLoader when the
   // page touches iframe.contentWindow or sets iframe.src.
@@ -190,19 +187,18 @@ BrowserElementParent::OpenWindowResult B
   // we've verified that the popup has gone through successfully.  If the popup
   // is "blocked" by the embedder, we don't want to load the popup's url.
   //
   // Therefore we call DisallowCreateFrameLoader() on the element and call
   // AllowCreateFrameLoader() only after we've verified that the popup was
   // allowed.
   popupFrameElement->DisallowCreateFrameLoader();
 
-  OpenWindowResult opened =
-      DispatchOpenWindowEvent(openerFrameElement, popupFrameElement, aURL,
-                              aName, aForceNoReferrer, aFeatures);
+  OpenWindowResult opened = DispatchOpenWindowEvent(
+      openerFrameElement, popupFrameElement, aURL, aName, aFeatures);
 
   if (opened != BrowserElementParent::OPEN_WINDOW_ADDED) {
     return opened;
   }
 
   // The popup was not blocked, so hook up the frame element and the popup tab
   // parent, and return success.
   aPopupTabParent->SetOwnerElement(popupFrameElement);
@@ -248,17 +244,17 @@ BrowserElementParent::OpenWindowInProces
     ErrorResult res;
     popupFrameElement->PresetOpenerWindow(WindowProxyHolder(aOpenerWindow),
                                           res);
     MOZ_ASSERT(!res.Failed());
   }
 
   OpenWindowResult opened = DispatchOpenWindowEvent(
       openerFrameElement, popupFrameElement, NS_ConvertUTF8toUTF16(spec), aName,
-      false, NS_ConvertUTF8toUTF16(aFeatures));
+      NS_ConvertUTF8toUTF16(aFeatures));
 
   if (opened != BrowserElementParent::OPEN_WINDOW_ADDED) {
     return opened;
   }
 
   // Return popupFrameElement's window.
   RefPtr<nsFrameLoader> frameLoader = popupFrameElement->GetFrameLoader();
   NS_ENSURE_TRUE(frameLoader, BrowserElementParent::OPEN_WINDOW_IGNORED);
--- a/dom/browser-element/BrowserElementParent.h
+++ b/dom/browser-element/BrowserElementParent.h
@@ -85,17 +85,16 @@ class BrowserElementParent {
    * @return an OpenWindowresult that describes whether the embedder added the
    *         frame to a document and whether it called preventDefault to prevent
    *         the platform from handling the open request.
    */
   static OpenWindowResult OpenWindowOOP(dom::TabParent* aOpenerTabParent,
                                         dom::TabParent* aPopupTabParent,
                                         const nsAString& aURL,
                                         const nsAString& aName,
-                                        bool aForceNoReferrer,
                                         const nsAString& aFeatures);
 
   /**
    * Handle a window.open call from an in-process <iframe mozbrowser>.
    *
    * (These parameter types are silly, but they match what our caller has in
    * hand.  Feel free to add an override, if they are inconvenient to you.)
    *
@@ -107,15 +106,15 @@ class BrowserElementParent {
   static OpenWindowResult OpenWindowInProcess(
       mozilla::dom::BrowsingContext* aOpenerWindow, nsIURI* aURI,
       const nsAString& aName, const nsACString& aFeatures, bool aForceNoOpener,
       mozIDOMWindowProxy** aReturnWindow);
 
  private:
   static OpenWindowResult DispatchOpenWindowEvent(
       dom::Element* aOpenerFrameElement, dom::Element* aPopupFrameElement,
-      const nsAString& aURL, const nsAString& aName, bool aForceNoReferrer,
+      const nsAString& aURL, const nsAString& aName,
       const nsAString& aFeatures);
 };
 
 }  // namespace mozilla
 
 #endif
--- a/dom/clients/manager/ClientOpenWindowUtils.cpp
+++ b/dom/clients/manager/ClientOpenWindowUtils.cpp
@@ -236,17 +236,16 @@ nsresult OpenWindow(const ClientOpenWind
     rv = pwwatch->OpenWindow2(
         nullptr, spec.get(), nullptr, nullptr, false, false, true, nullptr,
         // Not a spammy popup; we got permission, we swear!
         /* aIsPopupSpam = */ false,
         // Don't force noopener.  We're not passing in an
         // opener anyway, and we _do_ want the returned
         // window.
         /* aForceNoOpener = */ false,
-        /* aForceNoReferrer = */ false,
         /* aLoadInfp = */ nullptr, getter_AddRefs(newWindow));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
     nsCOMPtr<nsPIDOMWindowOuter> pwindow = nsPIDOMWindowOuter::From(newWindow);
     pwindow.forget(aWindow);
     MOZ_DIAGNOSTIC_ASSERT(*aWindow);
     return NS_OK;
--- a/dom/interfaces/base/nsIBrowserDOMWindow.idl
+++ b/dom/interfaces/base/nsIBrowserDOMWindow.idl
@@ -91,22 +91,16 @@ interface nsIBrowserDOMWindow : nsISuppo
   const long OPEN_EXTERNAL      = 0x1;
 
   /**
    * Don't set the window.opener property on the window which is being opened.
    */
   const long OPEN_NO_OPENER     = 0x4;
 
   /**
-   * Don't set the referrer on the navigation inside the window which is
-   * being opened.
-   */
-  const long OPEN_NO_REFERRER   = 0x8;
-
-  /**
    * Create the content window for the given URI.
 
    * @param aURI the URI to be opened in the window (can be null).
    * @param aWhere see possible values described above.
    * @param aOpener window requesting the creation (can be null).
    * @param aFlags flags which control the behavior of the load. The
    *               OPEN_EXTERNAL/OPEN_NEW flag is only used when
    *               aWhere == OPEN_DEFAULTWINDOW.
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -749,48 +749,44 @@ void ContentChild::SetProcessName(const 
 #endif
 }
 
 NS_IMETHODIMP
 ContentChild::ProvideWindow(mozIDOMWindowProxy* aParent, uint32_t aChromeFlags,
                             bool aCalledFromJS, bool aPositionSpecified,
                             bool aSizeSpecified, nsIURI* aURI,
                             const nsAString& aName, const nsACString& aFeatures,
-                            bool aForceNoOpener, bool aForceNoReferrer,
+                            bool aForceNoOpener,
                             nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
                             mozIDOMWindowProxy** aReturn) {
-  return ProvideWindowCommon(
-      nullptr, aParent, false, aChromeFlags, aCalledFromJS, aPositionSpecified,
-      aSizeSpecified, aURI, aName, aFeatures, aForceNoOpener, aForceNoReferrer,
-      aLoadState, aWindowIsNew, aReturn);
+  return ProvideWindowCommon(nullptr, aParent, false, aChromeFlags,
+                             aCalledFromJS, aPositionSpecified, aSizeSpecified,
+                             aURI, aName, aFeatures, aForceNoOpener, aLoadState,
+                             aWindowIsNew, aReturn);
 }
 
 static nsresult GetCreateWindowParams(mozIDOMWindowProxy* aParent,
                                       nsDocShellLoadState* aLoadState,
-                                      bool aForceNoReferrer, float* aFullZoom,
+                                      float* aFullZoom,
                                       nsIReferrerInfo** aReferrerInfo,
                                       nsIPrincipal** aTriggeringPrincipal,
                                       nsIContentSecurityPolicy** aCsp) {
   *aFullZoom = 1.0f;
   if (!aTriggeringPrincipal || !aCsp) {
     NS_ERROR("aTriggeringPrincipal || aCsp is null");
     return NS_ERROR_FAILURE;
   }
 
   if (!aReferrerInfo) {
     NS_ERROR("aReferrerInfo is null");
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIReferrerInfo> referrerInfo;
-  if (aForceNoReferrer) {
-    referrerInfo = new ReferrerInfo(
-        nullptr, mozilla::net::ReferrerPolicy::RP_Unset, false);
-  }
-  if (aLoadState && !referrerInfo) {
+  if (aLoadState) {
     referrerInfo = aLoadState->GetReferrerInfo();
   }
 
   auto* opener = nsPIDOMWindowOuter::From(aParent);
   if (!opener) {
     nsCOMPtr<nsIPrincipal> nullPrincipal =
         NullPrincipal::CreateWithoutOriginAttributes();
     if (!referrerInfo) {
@@ -841,17 +837,17 @@ static nsresult GetCreateWindowParams(mo
 
   return NS_OK;
 }
 
 nsresult ContentChild::ProvideWindowCommon(
     TabChild* aTabOpener, mozIDOMWindowProxy* aParent, bool aIframeMoz,
     uint32_t aChromeFlags, bool aCalledFromJS, bool aPositionSpecified,
     bool aSizeSpecified, nsIURI* aURI, const nsAString& aName,
-    const nsACString& aFeatures, bool aForceNoOpener, bool aForceNoReferrer,
+    const nsACString& aFeatures, bool aForceNoOpener,
     nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
     mozIDOMWindowProxy** aReturn) {
   *aReturn = nullptr;
 
   nsAutoPtr<IPCTabContext> ipcContext;
   TabId openerTabId = TabId(0);
   nsAutoCString features(aFeatures);
   nsAutoString name(aName);
@@ -887,20 +883,19 @@ nsresult ContentChild::ProvideWindowComm
 
   // If we're in a content process and we have noopener set, there's no reason
   // to load in our process, so let's load it elsewhere!
   if (loadInDifferentProcess) {
     float fullZoom;
     nsCOMPtr<nsIPrincipal> triggeringPrincipal;
     nsCOMPtr<nsIContentSecurityPolicy> csp;
     nsCOMPtr<nsIReferrerInfo> referrerInfo;
-    rv = GetCreateWindowParams(aParent, aLoadState, aForceNoReferrer, &fullZoom,
-                               getter_AddRefs(referrerInfo),
-                               getter_AddRefs(triggeringPrincipal),
-                               getter_AddRefs(csp));
+    rv = GetCreateWindowParams(
+        aParent, aLoadState, &fullZoom, getter_AddRefs(referrerInfo),
+        getter_AddRefs(triggeringPrincipal), getter_AddRefs(csp));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     Maybe<URIParams> uriToLoad;
     SerializeURI(aURI, uriToLoad);
 
     if (name.LowerCaseEqualsLiteral("_blank")) {
@@ -1106,28 +1101,27 @@ nsresult ContentChild::ProvideWindowComm
       // We can't actually send a nullptr up as the URI, since IPDL doesn't let
       // us send nullptr's for primitives. We indicate that the nsString for the
       // URI should be converted to a nullptr by voiding the string.
       url.SetIsVoid(true);
     }
 
     // NOTE: BrowserFrameOpenWindowPromise is the same type as
     // CreateWindowPromise, and this code depends on that fact.
-    newChild->SendBrowserFrameOpenWindow(
-        aTabOpener, NS_ConvertUTF8toUTF16(url), name, aForceNoReferrer,
-        NS_ConvertUTF8toUTF16(features), std::move(resolve), std::move(reject));
+    newChild->SendBrowserFrameOpenWindow(aTabOpener, NS_ConvertUTF8toUTF16(url),
+                                         name, NS_ConvertUTF8toUTF16(features),
+                                         std::move(resolve), std::move(reject));
   } else {
     float fullZoom;
     nsCOMPtr<nsIPrincipal> triggeringPrincipal;
     nsCOMPtr<nsIContentSecurityPolicy> csp;
     nsCOMPtr<nsIReferrerInfo> referrerInfo;
-    rv = GetCreateWindowParams(aParent, aLoadState, aForceNoReferrer, &fullZoom,
-                               getter_AddRefs(referrerInfo),
-                               getter_AddRefs(triggeringPrincipal),
-                               getter_AddRefs(csp));
+    rv = GetCreateWindowParams(
+        aParent, aLoadState, &fullZoom, getter_AddRefs(referrerInfo),
+        getter_AddRefs(triggeringPrincipal), getter_AddRefs(csp));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     Maybe<URIParams> uriToLoad;
     if (aURI) {
       SerializeURI(aURI, uriToLoad);
     }
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -104,23 +104,25 @@ class ContentChild final : public PConte
     nsCString buildID;
     nsCString name;
     nsCString UAName;
     nsCString ID;
     nsCString vendor;
     nsCString sourceURL;
   };
 
-  nsresult ProvideWindowCommon(
-      TabChild* aTabOpener, mozIDOMWindowProxy* aParent, bool aIframeMoz,
-      uint32_t aChromeFlags, bool aCalledFromJS, bool aPositionSpecified,
-      bool aSizeSpecified, nsIURI* aURI, const nsAString& aName,
-      const nsACString& aFeatures, bool aForceNoOpener, bool aForceNoReferrer,
-      nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
-      mozIDOMWindowProxy** aReturn);
+  nsresult ProvideWindowCommon(TabChild* aTabOpener,
+                               mozIDOMWindowProxy* aOpener, bool aIframeMoz,
+                               uint32_t aChromeFlags, bool aCalledFromJS,
+                               bool aPositionSpecified, bool aSizeSpecified,
+                               nsIURI* aURI, const nsAString& aName,
+                               const nsACString& aFeatures, bool aForceNoOpener,
+                               nsDocShellLoadState* aLoadState,
+                               bool* aWindowIsNew,
+                               mozIDOMWindowProxy** aReturn);
 
   bool Init(MessageLoop* aIOLoop, base::ProcessId aParentPid,
             const char* aParentBuildID, IPC::Channel* aChannel,
             uint64_t aChildID, bool aIsForBrowser);
 
   void InitXPCOM(const XPCOMInitData& aXPCOMInit,
                  const mozilla::dom::ipc::StructuredCloneData& aInitialData);
 
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -449,18 +449,17 @@ parent:
      *
      * The parent process gets a chance to accept or reject the window.open
      * call, and windowOpened is set to true if we ended up going through with
      * the window.open.
      *
      * @param opener the PBrowser whose content called window.open.
      */
     async BrowserFrameOpenWindow(PBrowser opener,
-                                 nsString aURL, nsString aName,
-                                 bool aForceNoReferrer, nsString aFeatures)
+                                 nsString aURL, nsString aName, nsString aFeatures)
         returns (CreatedWindowInfo window);
 
     /**
      * Tells the containing widget whether the given input block results in a
      * swipe. Should be called in response to a WidgetWheelEvent that has
      * mFlags.mCanTriggerSwipe set on it.
      */
     async RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe);
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -896,19 +896,18 @@ TabChild::GetInterface(const nsIID& aIID
   return QueryInterface(aIID, aSink);
 }
 
 NS_IMETHODIMP
 TabChild::ProvideWindow(mozIDOMWindowProxy* aParent, uint32_t aChromeFlags,
                         bool aCalledFromJS, bool aPositionSpecified,
                         bool aSizeSpecified, nsIURI* aURI,
                         const nsAString& aName, const nsACString& aFeatures,
-                        bool aForceNoOpener, bool aForceNoReferrer,
-                        nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
-                        mozIDOMWindowProxy** aReturn) {
+                        bool aForceNoOpener, nsDocShellLoadState* aLoadState,
+                        bool* aWindowIsNew, mozIDOMWindowProxy** aReturn) {
   *aReturn = nullptr;
 
   // If aParent is inside an <iframe mozbrowser> and this isn't a request to
   // open a modal-type window, we're going to create a new <iframe mozbrowser>
   // and return its window here.
   nsCOMPtr<nsIDocShell> docshell = do_GetInterface(aParent);
   bool iframeMoz =
       (docshell && docshell->GetIsInMozBrowser() &&
@@ -931,18 +930,18 @@ TabChild::ProvideWindow(mozIDOMWindowPro
   }
 
   // Note that ProvideWindowCommon may return NS_ERROR_ABORT if the
   // open window call was canceled.  It's important that we pass this error
   // code back to our caller.
   ContentChild* cc = ContentChild::GetSingleton();
   return cc->ProvideWindowCommon(
       this, aParent, iframeMoz, aChromeFlags, aCalledFromJS, aPositionSpecified,
-      aSizeSpecified, aURI, aName, aFeatures, aForceNoOpener, aForceNoReferrer,
-      aLoadState, aWindowIsNew, aReturn);
+      aSizeSpecified, aURI, aName, aFeatures, aForceNoOpener, aLoadState,
+      aWindowIsNew, aReturn);
 }
 
 void TabChild::DestroyWindow() {
   if (mBrowsingContext) {
     mBrowsingContext = nullptr;
   }
 
   if (mStatusFilter) {
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2870,26 +2870,24 @@ void TabParent::ApzAwareEventRoutingToCh
     if (aOutApzResponse) {
       *aOutApzResponse = nsEventStatus_eIgnore;
     }
   }
 }
 
 mozilla::ipc::IPCResult TabParent::RecvBrowserFrameOpenWindow(
     PBrowserParent* aOpener, const nsString& aURL, const nsString& aName,
-    bool aForceNoReferrer, const nsString& aFeatures,
-    BrowserFrameOpenWindowResolver&& aResolve) {
+    const nsString& aFeatures, BrowserFrameOpenWindowResolver&& aResolve) {
   CreatedWindowInfo cwi;
   cwi.rv() = NS_OK;
   cwi.maxTouchPoints() = 0;
 
   BrowserElementParent::OpenWindowResult opened =
       BrowserElementParent::OpenWindowOOP(TabParent::GetFrom(aOpener), this,
-                                          aURL, aName, aForceNoReferrer,
-                                          aFeatures);
+                                          aURL, aName, aFeatures);
   cwi.windowOpened() = (opened == BrowserElementParent::OPEN_WINDOW_ADDED);
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (widget) {
     cwi.maxTouchPoints() = widget->GetMaxTouchPoints();
     cwi.dimensions() = GetDimensionInfo();
   }
 
   // Resolve the request with the information we collected.
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -187,18 +187,17 @@ class TabParent final : public PBrowserP
   void ReconstructWebProgressAndRequest(
       nsIWebProgress* aManager, const Maybe<WebProgressData>& aWebProgressData,
       const RequestData& aRequestData,
       nsCOMPtr<nsIWebProgress>& aOutWebProgress,
       nsCOMPtr<nsIRequest>& aOutRequest);
 
   mozilla::ipc::IPCResult RecvBrowserFrameOpenWindow(
       PBrowserParent* aOpener, const nsString& aURL, const nsString& aName,
-      bool aForceNoReferrer, const nsString& aFeatures,
-      BrowserFrameOpenWindowResolver&& aResolve);
+      const nsString& aFeatures, BrowserFrameOpenWindowResolver&& aResolve);
 
   mozilla::ipc::IPCResult RecvSyncMessage(
       const nsString& aMessage, const ClonedMessageData& aData,
       InfallibleTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
       nsTArray<ipc::StructuredCloneData>* aRetVal);
 
   mozilla::ipc::IPCResult RecvRpcMessage(
       const nsString& aMessage, const ClonedMessageData& aData,
--- a/dom/tests/browser/browser_noopener.js
+++ b/dom/tests/browser/browser_noopener.js
@@ -5,21 +5,21 @@ const TESTS = [
   {id: "#test3", name: "", opener: false, newWindow: false},
 
   {id: "#test4", name: "uniquename1", opener: true, newWindow: false},
   {id: "#test5", name: "uniquename2", opener: false, newWindow: false},
   {id: "#test6", name: "uniquename3", opener: false, newWindow: false},
 
   {id: "#test7", name: "", opener: true, newWindow: false},
   {id: "#test8", name: "", opener: false, newWindow: false},
-  {id: "#test9", name: "", opener: false, newWindow: false},
+  {id: "#test9", name: "", opener: true, newWindow: true},
 
   {id: "#test10", name: "uniquename1", opener: true, newWindow: false},
   {id: "#test11", name: "uniquename2", opener: false, newWindow: false},
-  {id: "#test12", name: "uniquename3", opener: false, newWindow: false},
+  {id: "#test12", name: "uniquename3", opener: true, newWindow: true},
 ];
 
 const TEST_URL = "http://mochi.test:8888/browser/dom/tests/browser/test_noopener_source.html";
 const TARGET_URL = "http://mochi.test:8888/browser/dom/tests/browser/test_noopener_target.html";
 
 const OPEN_NEWWINDOW_PREF = "browser.link.open_newwindow";
 const OPEN_NEWWINDOW = 2;
 const OPEN_NEWTAB = 3;
@@ -94,20 +94,16 @@ async function doAllTests() {
   // Non-private window with container
   await doTests(false, true);
 }
 
 // This test takes a really long time, especially in debug builds, as it is
 // constant starting and stopping processes, and opens a new window ~144 times.
 requestLongerTimeout(25);
 
-add_task(async function prepare() {
-  await SpecialPowers.pushPrefEnv({set: [["dom.window.open.noreferrer.enabled", true]]});
-});
-
 add_task(async function newtab_sameproc() {
   await SpecialPowers.pushPrefEnv({set: [[OPEN_NEWWINDOW_PREF, OPEN_NEWTAB],
                                          [NOOPENER_NEWPROC_PREF, false]]});
   await doAllTests();
 });
 
 add_task(async function newtab_newproc() {
   await SpecialPowers.pushPrefEnv({set: [[OPEN_NEWWINDOW_PREF, OPEN_NEWTAB],
--- a/dom/webidl/BrowserElementDictionaries.webidl
+++ b/dom/webidl/BrowserElementDictionaries.webidl
@@ -7,15 +7,14 @@
  * liability, trademark and document use rules apply.
  */
 
 dictionary OpenWindowEventDetail {
   DOMString url = "";
   DOMString name = "";
   DOMString features = "";
   Node? frameElement = null;
-  boolean forceNoReferrer = false;
 };
 
 dictionary DOMWindowResizeEventDetail {
   long width = 0;
   long height = 0;
 };
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3407,21 +3407,20 @@ nsBrowserAccess.prototype = {
       } else {
         aWhere = Services.prefs.getIntPref("browser.link.open_newwindow");
       }
     }
 
     Services.io.offline = false;
 
     let referrer;
-    let forceNoReferrer = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_REFERRER);
     if (aOpener) {
       try {
         let location = aOpener.location;
-        referrer = forceNoReferrer ? null : Services.io.newURI(location);
+        referrer = Services.io.newURI(location);
       } catch(e) { }
     }
 
     let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
     let pinned = false;
 
     if (aURI && aWhere == Ci.nsIBrowserDOMWindow.OPEN_SWITCHTAB) {
       pinned = true;
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -585,24 +585,16 @@ VARCACHE_PREF(
 )
 
 VARCACHE_PREF(
   "dom.storage_access.auto_grants.delayed",
    dom_storage_access_auto_grants_delayed,
   bool, true
 )
 
-// Enable the "noreferrer" feature argument for window.open()
-VARCACHE_PREF(
-  "dom.window.open.noreferrer.enabled",
-   dom_window_open_noreferrer_enabled,
-  bool, true
-)
-
-
 //---------------------------------------------------------------------------
 // Extension prefs
 //---------------------------------------------------------------------------
 
 #ifdef ANDROID
 // Private browsing opt-in is only supported on Firefox desktop.
 # define PREF_VALUE true
 #else
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/html/browsers/the-window-object/window-open-noreferrer.html.ini
@@ -0,0 +1,4 @@
+[window-open-noreferrer.html]
+  [window.open() with "noreferrer" tests]
+    expected: FAIL
+
--- a/toolkit/components/windowcreator/nsIWindowProvider.idl
+++ b/toolkit/components/windowcreator/nsIWindowProvider.idl
@@ -101,12 +101,11 @@ interface nsIWindowProvider : nsISupport
                                    in unsigned long aChromeFlags,
                                    in boolean aCalledFromJS,
                                    in boolean aPositionSpecified,
                                    in boolean aSizeSpecified,
                                    in nsIURI aURI,
                                    in AString aName,
                                    in AUTF8String aFeatures,
                                    in boolean aForceNoOpener,
-                                   in boolean aForceNoReferrer,
                                    in nsDocShellLoadStatePtr aLoadState,
                                    out boolean aWindowIsNew);
 };
--- a/toolkit/components/windowwatcher/nsPIWindowWatcher.idl
+++ b/toolkit/components/windowwatcher/nsPIWindowWatcher.idl
@@ -84,17 +84,16 @@ interface nsPIWindowWatcher : nsISupport
   mozIDOMWindowProxy openWindow2(in mozIDOMWindowProxy aParent, in string aUrl,
                                  in string aName, in string aFeatures,
                                  in boolean aCalledFromScript,
                                  in boolean aDialog,
                                  in boolean aNavigate,
                                  in nsISupports aArgs,
                                  in boolean aIsPopupSpam,
                                  in boolean aForceNoOpener,
-                                 in boolean aForceNoReferrer,
                                  in nsDocShellLoadStatePtr aLoadState);
 
   /**
    * Opens a new window so that the window that aOpeningTab belongs to
    * is set as the parent window. The newly opened window will also
    * inherit load context information from aOpeningTab.
    *
    * @param aOpeningTab
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -287,17 +287,16 @@ nsWindowWatcher::OpenWindow(mozIDOMWindo
   }
   bool dialog = (argc != 0);
 
   return OpenWindowInternal(aParent, aUrl, aName, aFeatures,
                             /* calledFromJS = */ false, dialog,
                             /* navigate = */ true, argv,
                             /* aIsPopupSpam = */ false,
                             /* aForceNoOpener = */ false,
-                            /* aForceNoReferrer = */ false,
                             /* aLoadState = */ nullptr, aResult);
 }
 
 struct SizeSpec {
   SizeSpec()
       : mLeft(0),
         mTop(0),
         mOuterWidth(0),
@@ -343,17 +342,16 @@ struct SizeSpec {
 };
 
 NS_IMETHODIMP
 nsWindowWatcher::OpenWindow2(mozIDOMWindowProxy* aParent, const char* aUrl,
                              const char* aName, const char* aFeatures,
                              bool aCalledFromScript, bool aDialog,
                              bool aNavigate, nsISupports* aArguments,
                              bool aIsPopupSpam, bool aForceNoOpener,
-                             bool aForceNoReferrer,
                              nsDocShellLoadState* aLoadState,
                              mozIDOMWindowProxy** aResult) {
   nsCOMPtr<nsIArray> argv = ConvertArgsToArray(aArguments);
 
   uint32_t argc = 0;
   if (argv) {
     argv->GetLength(&argc);
   }
@@ -363,18 +361,17 @@ nsWindowWatcher::OpenWindow2(mozIDOMWind
   // called from script.  Fixing this is bug 779939.
   bool dialog = aDialog;
   if (!aCalledFromScript) {
     dialog = argc > 0;
   }
 
   return OpenWindowInternal(aParent, aUrl, aName, aFeatures, aCalledFromScript,
                             dialog, aNavigate, argv, aIsPopupSpam,
-                            aForceNoOpener, aForceNoReferrer, aLoadState,
-                            aResult);
+                            aForceNoOpener, aLoadState, aResult);
 }
 
 // This static function checks if the aDocShell uses an UserContextId equal to
 // the userContextId of subjectPrincipal, if not null.
 static bool CheckUserContextCompatibility(nsIDocShell* aDocShell) {
   MOZ_ASSERT(aDocShell);
 
   uint32_t userContextId =
@@ -576,20 +573,17 @@ nsWindowWatcher::OpenWindowWithTabParent
   newTabParent.forget(aResult);
   return NS_OK;
 }
 
 nsresult nsWindowWatcher::OpenWindowInternal(
     mozIDOMWindowProxy* aParent, const char* aUrl, const char* aName,
     const char* aFeatures, bool aCalledFromJS, bool aDialog, bool aNavigate,
     nsIArray* aArgv, bool aIsPopupSpam, bool aForceNoOpener,
-    bool aForceNoReferrer, nsDocShellLoadState* aLoadState,
-    mozIDOMWindowProxy** aResult) {
-  MOZ_ASSERT_IF(aForceNoReferrer, aForceNoOpener);
-
+    nsDocShellLoadState* aLoadState, mozIDOMWindowProxy** aResult) {
   nsresult rv = NS_OK;
   bool isNewToplevelWindow = false;
   bool windowIsNew = false;
   bool windowNeedsName = false;
   bool windowIsModal = false;
   bool uriToLoadIsChrome = false;
   bool windowIsModalContentDialog = false;
 
@@ -762,18 +756,17 @@ nsresult nsWindowWatcher::OpenWindowInte
         provider = nsContentUtils::GetWindowProviderForContentProcess();
       }
 
       if (provider) {
         nsCOMPtr<mozIDOMWindowProxy> newWindow;
         rv = provider->ProvideWindow(
             aParent, chromeFlags, aCalledFromJS, sizeSpec.PositionSpecified(),
             sizeSpec.SizeSpecified(), uriToLoad, name, features, aForceNoOpener,
-            aForceNoReferrer, aLoadState, &windowIsNew,
-            getter_AddRefs(newWindow));
+            aLoadState, &windowIsNew, getter_AddRefs(newWindow));
 
         if (NS_SUCCEEDED(rv)) {
           GetWindowTreeItem(newWindow, getter_AddRefs(newDocShellItem));
           if (windowIsNew && newDocShellItem) {
             // Make sure to stop any loads happening in this window that the
             // window provider might have started.  Otherwise if our caller
             // manipulates the window it just opened and then the load
             // completes their stuff will get blown away.
@@ -1081,32 +1074,30 @@ nsresult nsWindowWatcher::OpenWindowInte
     if (subjectPrincipal) {
       loadState->SetTriggeringPrincipal(subjectPrincipal);
     }
 #ifndef ANDROID
     MOZ_ASSERT(subjectPrincipal,
                "nsWindowWatcher: triggeringPrincipal required");
 #endif
 
-    if (!aForceNoReferrer) {
-      /* use the URL from the *extant* document, if any. The usual accessor
-         GetDocument will synchronously create an about:blank document if
-         it has no better answer, and we only care about a real document.
-         Also using GetDocument to force document creation seems to
-         screw up focus in the hidden window; see bug 36016.
-      */
-      RefPtr<Document> doc = GetEntryDocument();
-      if (!doc && parentWindow) {
-        doc = parentWindow->GetExtantDoc();
-      }
-      if (doc) {
-        nsCOMPtr<nsIReferrerInfo> referrerInfo =
-            new ReferrerInfo(doc->GetDocumentURI(), doc->GetReferrerPolicy());
-        loadState->SetReferrerInfo(referrerInfo);
-      }
+    /* use the URL from the *extant* document, if any. The usual accessor
+       GetDocument will synchronously create an about:blank document if
+       it has no better answer, and we only care about a real document.
+       Also using GetDocument to force document creation seems to
+       screw up focus in the hidden window; see bug 36016.
+    */
+    RefPtr<Document> doc = GetEntryDocument();
+    if (!doc && parentWindow) {
+      doc = parentWindow->GetExtantDoc();
+    }
+    if (doc) {
+      nsCOMPtr<nsIReferrerInfo> referrerInfo =
+          new ReferrerInfo(doc->GetDocumentURI(), doc->GetReferrerPolicy());
+      loadState->SetReferrerInfo(referrerInfo);
     }
   }
 
   // Currently we query the CSP from the principal of the inner window.
   // After Bug 965637 we can query the CSP directly from the inner window.
   // Further, if the JS context is null, then the subjectPrincipal falls
   // back to being the SystemPrincipal (see above) and the SystemPrincipal
   // can currently not hold a CSP. We use the same semantics here.
--- a/toolkit/components/windowwatcher/nsWindowWatcher.h
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.h
@@ -79,17 +79,17 @@ class nsWindowWatcher : public nsIWindow
                                           mozIDOMWindowProxy* aCurrentWindow);
 
   // Just like OpenWindowJS, but knows whether it got called via OpenWindowJS
   // (which means called from script) or called via OpenWindow.
   nsresult OpenWindowInternal(mozIDOMWindowProxy* aParent, const char* aUrl,
                               const char* aName, const char* aFeatures,
                               bool aCalledFromJS, bool aDialog, bool aNavigate,
                               nsIArray* aArgv, bool aIsPopupSpam,
-                              bool aForceNoOpener, bool aForceNoReferrer,
+                              bool aForceNoOpener,
                               nsDocShellLoadState* aLoadState,
                               mozIDOMWindowProxy** aResult);
 
   static nsresult URIfromURL(const char* aURL, mozIDOMWindowProxy* aParent,
                              nsIURI** aURI);
 
   static uint32_t CalculateChromeFlagsForChild(const nsACString& aFeaturesStr);
 
--- a/xpfe/appshell/nsContentTreeOwner.cpp
+++ b/xpfe/appshell/nsContentTreeOwner.cpp
@@ -698,17 +698,17 @@ NS_IMETHODIMP nsContentTreeOwner::SetTit
 //*****************************************************************************
 // nsContentTreeOwner: nsIWindowProvider
 //*****************************************************************************
 NS_IMETHODIMP
 nsContentTreeOwner::ProvideWindow(
     mozIDOMWindowProxy* aParent, uint32_t aChromeFlags, bool aCalledFromJS,
     bool aPositionSpecified, bool aSizeSpecified, nsIURI* aURI,
     const nsAString& aName, const nsACString& aFeatures, bool aForceNoOpener,
-    bool aForceNoReferrer, nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
+    nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
     mozIDOMWindowProxy** aReturn) {
   NS_ENSURE_ARG_POINTER(aParent);
 
   auto* parentWin = nsPIDOMWindowOuter::From(aParent);
   dom::BrowsingContext* parent =
       parentWin ? parentWin->GetBrowsingContext() : nullptr;
 
   *aReturn = nullptr;
@@ -792,19 +792,16 @@ nsContentTreeOwner::ProvideWindow(
 
   {
     dom::AutoNoJSAPI nojsapi;
 
     uint32_t flags = nsIBrowserDOMWindow::OPEN_NEW;
     if (aForceNoOpener) {
       flags |= nsIBrowserDOMWindow::OPEN_NO_OPENER;
     }
-    if (aForceNoReferrer) {
-      flags |= nsIBrowserDOMWindow::OPEN_NO_REFERRER;
-    }
 
     // Get a new rendering area from the browserDOMWin.
     // Since we are not loading any URI, we follow the principle of least
     // privilege and use a nullPrincipal as the triggeringPrincipal.
     //
     // This method handles setting the opener for us, so we don't need to set it
     // ourselves.
     RefPtr<NullPrincipal> nullPrincipal =