Bug 1524992 - Treat command line URIs as external r=mconley
☠☠ backed out by 5943b02bfa38 ☠ ☠
authorJames Willcox <snorp@snorp.net>
Wed, 27 Feb 2019 15:57:44 +0000
changeset 519342 bd215cd3c8d71e1c66fb01d6a08ac6773f9e51e1
parent 519341 bd76311c316a72934e367578dea3c433967a2bad
child 519343 fb1d7e57e253c6922a51d436dc0796e8411b24eb
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1524992
milestone67.0a1
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
Bug 1524992 - Treat command line URIs as external r=mconley Differential Revision: https://phabricator.services.mozilla.com/D20890
browser/base/content/browser.js
browser/base/content/tabbrowser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1687,16 +1687,17 @@ var gBrowserInit = {
           gBrowser.loadTabs(uriToLoad, {
             inBackground: false,
             replace: true,
             // See below for the semantics of window.arguments. Only the minimum is supported.
             userContextId: window.arguments[6],
             triggeringPrincipal: window.arguments[8] || Services.scriptSecurityManager.getSystemPrincipal(),
             allowInheritPrincipal: window.arguments[9],
             csp: window.arguments[10],
+            fromExternal: true,
           });
         } catch (e) {}
       } else if (window.arguments.length >= 3) {
         // window.arguments[1]: unused (bug 871161)
         //                 [2]: referrer (nsIURI | string)
         //                 [3]: postData (nsIInputStream)
         //                 [4]: allowThirdPartyFixup (bool)
         //                 [5]: referrerPolicy (int)
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1481,16 +1481,17 @@ window._gBrowser = {
     inBackground,
     newIndex,
     postDatas,
     replace,
     targetTab,
     triggeringPrincipal,
     csp,
     userContextId,
+    fromExternal,
   } = {}) {
     if (!aURIs.length) {
       return;
     }
 
     // The tab selected after this new tab is closed (i.e. the new tab's
     // "owner") is the next adjacent tab (i.e. not the previously viewed tab)
     // when several urls are opened here (i.e. closing the first should select
@@ -1532,16 +1533,19 @@ window._gBrowser = {
       let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
       if (allowThirdPartyFixup) {
         flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
           Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
       }
       if (!allowInheritPrincipal) {
         flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
       }
+      if (fromExternal) {
+        flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
+      }
       try {
         browser.loadURI(aURIs[0], {
           flags,
           postData: postDatas && postDatas[0],
           triggeringPrincipal,
           csp,
         });
       } catch (e) {
@@ -1554,16 +1558,17 @@ window._gBrowser = {
         ownerTab: owner,
         skipAnimation: multiple,
         allowThirdPartyFixup,
         postData: postDatas && postDatas[0],
         userContextId,
         triggeringPrincipal,
         bulkOrderedOpen: multiple,
         csp,
+        fromExternal,
       };
       if (newIndex > -1) {
         params.index = newIndex;
       }
       firstTabAdded = this.addTab(aURIs[0], params);
       if (newIndex > -1) {
         targetTabIndex = firstTabAdded._tPos;
       }
@@ -1575,16 +1580,17 @@ window._gBrowser = {
         allowInheritPrincipal,
         skipAnimation: true,
         allowThirdPartyFixup,
         postData: postDatas && postDatas[i],
         userContextId,
         triggeringPrincipal,
         bulkOrderedOpen: true,
         csp,
+        fromExternal,
       };
       if (targetTabIndex > -1) {
         params.index = ++tabNum;
       }
       this.addTab(aURIs[i], params);
     }
 
     if (firstTabAdded && !inBackground) {