Bug 1524992 - Treat command line URIs as external r=mconley
☠☠ backed out by 88ffdaa924cd ☠ ☠
authorJames Willcox <snorp@snorp.net>
Mon, 04 Mar 2019 22:06:30 +0000
changeset 520165 b0b9322c7a5986af47dd41331a1ffd6c196ffc53
parent 520164 d019f0762a071678ba7a280f1bdfbe5ccff02dae
child 520166 ae1e20a595c44100776589dcc1f76418208c88c7
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
@@ -1749,16 +1749,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
@@ -1525,16 +1525,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
@@ -1576,16 +1577,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) {
@@ -1598,16 +1602,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;
       }
@@ -1619,16 +1624,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) {