Backed out 2 changesets (bug 1362034) for failure at browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js on a CLOSED TREE
authordvarga <dvarga@mozilla.com>
Wed, 08 Aug 2018 22:11:56 +0300
changeset 430655 e643a04b3684d71d7a7e68ba82216665149b193e
parent 430654 71d8e454ebb94a7d649b0c7a12ed0723de46ab36
child 430656 fde2be8dca92ce77b2b6aefdcf5029ad99b52f18
push id106225
push userdvarga@mozilla.com
push dateWed, 08 Aug 2018 19:17:09 +0000
treeherdermozilla-inbound@e643a04b3684 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1362034
milestone63.0a1
backs out1c3329958b8a7603f04149ad4ab8e128ab5421e1
f68b1b76af362409c4985d6a892eda89a47e677b
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 2 changesets (bug 1362034) for failure at browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js on a CLOSED TREE Backed out changeset 1c3329958b8a (bug 1362034) Backed out changeset f68b1b76af36 (bug 1362034)
accessible/tests/mochitest/name/test_browserui.xul
browser/base/content/browser-captivePortal.js
browser/base/content/browser-context.inc
browser/base/content/browser.js
browser/base/content/nsContextMenu.js
browser/base/content/tabbrowser.js
browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js
browser/base/content/test/general/browser_bug462673.js
browser/base/content/test/general/browser_bug963945.js
browser/base/content/test/general/browser_tab_dragdrop2.js
browser/base/content/test/general/browser_trackingUI_5.js
browser/base/content/test/general/browser_utilityOverlay.js
browser/base/content/test/metaTags/browser_meta_tags.js
browser/base/content/test/performance/head.js
browser/base/content/test/referrer/head.js
browser/base/content/test/tabs/browser_new_tab_insert_position.js
browser/base/content/test/tabs/browser_pinnedTabs_closeByKeyboard.js
browser/base/content/test/tabs/browser_positional_attributes.js
browser/base/content/test/trackingUI/browser_trackingUI_animation.js
browser/base/content/test/trackingUI/browser_trackingUI_state.js
browser/base/content/test/urlbar/browser_URLBarSetURI.js
browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
browser/base/content/utilityOverlay.js
browser/components/extensions/parent/ext-browser.js
browser/components/extensions/parent/ext-tabs.js
browser/components/extensions/test/browser/browser-common.ini
browser/components/extensions/test/browser/browser_ext_tabs_create.js
browser/components/extensions/test/browser/browser_ext_tabs_create_url.js
browser/components/migration/tests/marionette/test_refresh_firefox.py
browser/components/nsBrowserGlue.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_noSessionRestoreMenuOption.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler.js
browser/components/safebrowsing/content/test/browser_whitelisted.js
browser/components/search/test/browser_contextSearchTabPosition.js
browser/components/search/test/browser_google_behavior.js
browser/components/search/test/browser_searchEngine_behaviors.js
browser/components/sessionstore/SessionStore.jsm
browser/components/sessionstore/content/aboutSessionRestore.js
browser/components/sessionstore/test/browser_354894_perwindowpb.js
browser/components/sessionstore/test/browser_625016.js
browser/components/sessionstore/test/browser_819510_perwindowpb.js
browser/components/sessionstore/test/browser_broadcast.js
browser/components/sessionstore/test/browser_cleaner.js
browser/components/sessionstore/test/browser_crashedTabs.js
browser/components/sessionstore/test/browser_dying_cache.js
browser/components/sessionstore/test/browser_privatetabs.js
browser/components/sessionstore/test/browser_scrollPositions.js
browser/components/sessionstore/test/browser_scrollPositionsReaderMode.js
browser/components/sessionstore/test/browser_switch_remoteness.js
browser/components/sessionstore/test/browser_undoCloseById.js
browser/components/sessionstore/test/browser_windowStateContainer.js
devtools/client/commandline/test/helpers.js
devtools/client/debugger/test/mochitest/head.js
devtools/client/framework/devtools-browser.js
devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js
devtools/client/performance-new/browser.js
devtools/client/responsive.html/browser/swap.js
devtools/client/styleeditor/test/head.js
devtools/client/webconsole/test/mochitest/browser_console_webconsole_private_browsing.js
devtools/startup/devtools-startup.js
devtools/startup/tests/browser/browser_shim_disable_devtools.js
docshell/base/nsDocShell.cpp
docshell/test/browser/head.js
dom/base/test/browser_blocking_image.js
dom/broadcastchannel/tests/browser_private_browsing.js
dom/cache/test/mochitest/browser_cache_pb_window.js
dom/html/test/browser_bug1108547.js
dom/indexedDB/test/browser_permissionsPromptDeny.js
dom/indexedDB/test/browser_perwindow_privateBrowsing.js
dom/quota/test/browser_permissionsPromptUnknown.js
dom/tests/browser/browser_localStorage_privatestorageevent.js
dom/tests/browser/helper_largeAllocation.js
mobile/android/chrome/content/browser.js
mobile/android/components/extensions/ext-tabs.js
testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
testing/mochitest/api.js
testing/mochitest/browser-test.js
testing/talos/talos/startup_test/sessionrestore/addon/bootstrap.js
testing/talos/talos/tests/devtools/addon/content/damp.js
testing/talos/talos/tests/tart/addon/content/tart.js
toolkit/components/extensions/test/browser/browser_ext_themes_tab_separators.js
toolkit/components/normandy/lib/Heartbeat.jsm
toolkit/content/tests/browser/browser_block_autoplay_media.js
toolkit/content/tests/browser/browser_block_autoplay_media_pausedAfterPlay.js
toolkit/content/tests/browser/browser_block_autoplay_playAfterTabVisible.js
toolkit/content/tests/browser/browser_block_multipleMedia.js
toolkit/content/tests/browser/browser_block_notInTreeAudio.js
toolkit/content/tests/browser/browser_block_playMediaInMuteTab.js
toolkit/content/tests/browser/browser_block_plugIn.js
toolkit/content/tests/browser/browser_block_silentAudioTrack_media.js
toolkit/content/tests/browser/browser_block_webAudio.js
toolkit/content/tests/browser/browser_resume_bkg_video_on_tab_hover.js
--- a/accessible/tests/mochitest/name/test_browserui.xul
+++ b/accessible/tests/mochitest/name/test_browserui.xul
@@ -27,17 +27,17 @@
     function addTab(aURL)
     {
       this.eventSeq = [
         new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1)
       ];
 
       this.invoke = function addTab_invoke()
       {
-        tabBrowser().addTrustedTab(aURL);
+        tabBrowser().addTab(aURL);
       }
 
       this.getID = function addTab_getID()
       {
         return "add tab: " + aURL;
       }
     }
 
--- a/browser/base/content/browser-captivePortal.js
+++ b/browser/base/content/browser-captivePortal.js
@@ -242,22 +242,17 @@ var CaptivePortalWatcher = {
   ensureCaptivePortalTab() {
     let tab;
     if (this._captivePortalTab) {
       tab = this._captivePortalTab.get();
     }
 
     // If the tab is gone or going, we need to open a new one.
     if (!tab || tab.closing || !tab.parentNode) {
-      tab = gBrowser.addWebTab(this.canonicalURL, {
-        ownerTab: gBrowser.selectedTab,
-        triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({
-          userContextId: gBrowser.contentPrincipal.userContextId,
-        }),
-      });
+      tab = gBrowser.addTab(this.canonicalURL, { ownerTab: gBrowser.selectedTab });
       this._captivePortalTab = Cu.getWeakReference(tab);
     }
 
     gBrowser.selectedTab = tab;
 
     let canonicalURI = makeURI(this.canonicalURL);
 
     // When we are no longer captive, close the tab if it's at the canonical URL.
--- a/browser/base/content/browser-context.inc
+++ b/browser/base/content/browser-context.inc
@@ -303,17 +303,17 @@
                 accesskey="&selectAllCmd.accesskey;"
                 command="cmd_selectAll"/>
       <menuseparator id="context-sep-selectall"/>
       <menuitem id="context-keywordfield"
                 label="&keywordfield.label;"
                 accesskey="&keywordfield.accesskey;"
                 oncommand="AddKeywordForSearchField();"/>
       <menuitem id="context-searchselect"
-                oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms, this.principal);"/>
+                oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms);"/>
       <menuseparator id="context-sep-sendlinktodevice" class="sync-ui-item"
                      hidden="true"/>
       <menu id="context-sendlinktodevice"
             class="sync-ui-item"
             label="&sendLinkToDevice.label;"
             accesskey="&sendLinkToDevice.accesskey;"
             hidden="true">
         <menupopup id="context-sendlinktodevice-popup"
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -533,18 +533,17 @@ const gStoragePressureObserver = {
     let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
     let prefStrBundle = document.getElementById("bundle_preferences");
     let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
     buttons.push({
       label: prefStrBundle.getString("spaceAlert.learnMoreButton.label"),
       accessKey: prefStrBundle.getString("spaceAlert.learnMoreButton.accesskey"),
       callback(notificationBar, button) {
         let learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
-        // This is a content URL, loaded from trusted UX.
-        gBrowser.selectedTab = gBrowser.addTrustedTab(learnMoreURL);
+        gBrowser.selectedTab = gBrowser.addTab(learnMoreURL);
       }
     });
     if (usage < USAGE_THRESHOLD_BYTES) {
       // The firefox-used space < 5GB, then warn user to free some disk space.
       // This is because this usage is small and not the main cause for space issue.
       // In order to avoid the bad and wrong impression among users that
       // firefox eats disk space a lot, indicate users to clean up other disk space.
       msg = prefStrBundle.getFormattedString("spaceAlert.under5GB.message", [brandShortName]);
@@ -3967,21 +3966,18 @@ const BrowserSearch = {
    * @param purpose [optional]
    *        A string meant to indicate the context of the search request. This
    *        allows the search service to provide a different nsISearchSubmission
    *        depending on e.g. where the search is triggered in the UI.
    *
    * @return engine The search engine used to perform a search, or null if no
    *                search was performed.
    */
-  _loadSearch(searchText, useNewTab, purpose, triggeringPrincipal) {
+  _loadSearch(searchText, useNewTab, purpose) {
     let engine;
-    if (!triggeringPrincipal) {
-      throw new Error("Required argument triggeringPrincipal missing within _loadSearch");
-    }
 
     // If the search bar is visible, use the current engine, otherwise, fall
     // back to the default engine.
     if (isElementVisible(this.searchBar))
       engine = Services.search.currentEngine;
     else
       engine = Services.search.defaultEngine;
 
@@ -3995,30 +3991,43 @@ const BrowserSearch = {
       return null;
     }
 
     let inBackground = Services.prefs.getBoolPref("browser.search.context.loadInBackground");
     openLinkIn(submission.uri.spec,
                useNewTab ? "tab" : "current",
                { postData: submission.postData,
                  inBackground,
-                 relatedToCurrent: true,
-                 triggeringPrincipal });
+                 relatedToCurrent: true });
 
     return engine;
   },
 
   /**
+   * Just like _loadSearch, but preserving an old API.
+   *
+   * @return string Name of the search engine used to perform a search or null
+   *         if a search was not performed.
+   */
+  loadSearch: function BrowserSearch_search(searchText, useNewTab, purpose) {
+    let engine = BrowserSearch._loadSearch(searchText, useNewTab, purpose);
+    if (!engine) {
+      return null;
+    }
+    return engine.name;
+  },
+
+  /**
    * Perform a search initiated from the context menu.
    *
    * This should only be called from the context menu. See
    * BrowserSearch.loadSearch for the preferred API.
    */
-  loadSearchFromContext(terms, triggeringPrincipal) {
-    let engine = BrowserSearch._loadSearch(terms, true, "contextmenu", triggeringPrincipal);
+  loadSearchFromContext(terms) {
+    let engine = BrowserSearch._loadSearch(terms, true, "contextmenu");
     if (engine) {
       BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
     }
   },
 
   pasteAndSearch(event) {
     BrowserSearch.searchBar.select();
     goDoCommand("cmd_paste");
@@ -7375,18 +7384,17 @@ const gAccessibilityServiceIndicator = {
     return Services.prefs.getBoolPref("accessibility.indicator.enabled");
   },
 
   handleEvent({ key, type }) {
     if ((type === "keypress" && [" ", "Enter"].includes(key)) ||
          type === "click") {
       let a11yServicesSupportURL =
         Services.urlFormatter.formatURLPref("accessibility.support.url");
-      // This is a known URL coming from trusted UI
-      gBrowser.selectedTab = gBrowser.addTrustedTab(a11yServicesSupportURL);
+      gBrowser.selectedTab = gBrowser.addTab(a11yServicesSupportURL);
       Services.telemetry.scalarSet("a11y.indicator_acted_on", true);
     }
   },
 
   uninit() {
     Services.prefs.removeObserver("accessibility.indicator.enabled", this);
     Services.obs.removeObserver(this, "a11y-init-or-shutdown");
     this.update();
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1497,17 +1497,16 @@ nsContextMenu.prototype = {
 
   // Formats the 'Search <engine> for "<selection or link text>"' context menu.
   formatSearchContextItem() {
     var menuItem = document.getElementById("context-searchselect");
     let selectedText = this.isTextSelected ? this.textSelected : this.linkTextStr;
 
     // Store searchTerms in context menu item so we know what to search onclick
     menuItem.searchTerms = selectedText;
-    menuItem.principal = this.principal;
 
     // Copied to alert.js' prefillAlertInfo().
     // If the JS character after our truncation point is a trail surrogate,
     // include it in the truncated string to avoid splitting a surrogate pair.
     if (selectedText.length > 15) {
       let truncLength = 15;
       let truncChar = selectedText[15].charCodeAt(0);
       if (truncChar >= 0xDC00 && truncChar <= 0xDFFF)
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1368,21 +1368,16 @@ window._gBrowser = {
       aOpener = params.opener;
       aOpenerBrowser = params.openerBrowser;
       aCreateLazyBrowser = params.createLazyBrowser;
       aNextTabParentId = params.nextTabParentId;
       aFocusUrlBar = params.focusUrlBar;
       aName = params.name;
     }
 
-    // all callers of loadOneTab need to pass a valid triggeringPrincipal.
-    if (!aTriggeringPrincipal) {
-      throw new Error("Required argument triggeringPrincipal missing within loadOneTab");
-    }
-
     var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
       Services.prefs.getBoolPref("browser.tabs.loadInBackground");
     var owner = bgLoad ? null : this.selectedTab;
 
     var tab = this.addTab(aURI, {
       triggeringPrincipal: aTriggeringPrincipal,
       referrerURI: aReferrerURI,
       referrerPolicy: aReferrerPolicy,
@@ -2134,40 +2129,16 @@ window._gBrowser = {
     tab.removeAttribute("linkedpanel");
 
     this._createLazyBrowser(tab);
 
     let evt = new CustomEvent("TabBrowserDiscarded", { bubbles: true });
     tab.dispatchEvent(evt);
   },
 
-  /**
-   * Loads a tab with a default null principal unless specified
-   */
-  addWebTab(aURI, params = {}) {
-    if (!params.triggeringPrincipal) {
-      params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({
-        userContextId: params.userContextId,
-      });
-    }
-    if (Services.scriptSecurityManager.isSystemPrincipal(params.triggeringPrincipal)) {
-      throw new Error("System principal should never be passed into addWebTab()");
-    }
-    return this.addTab(aURI, params);
-  },
-
-  /**
-   * Must only be used sparingly for content that came from Chrome context
-   * If in doubt use addWebTab
-   */
-  addTrustedTab(aURI, params = {}) {
-    params.triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
-    return this.addTab(aURI, params);
-  },
-
   // eslint-disable-next-line complexity
   addTab(aURI, {
     allowMixedContent,
     allowThirdPartyFixup,
     bulkOrderedOpen,
     charset,
     createLazyBrowser,
     disallowInheritPrincipal,
@@ -2193,23 +2164,16 @@ window._gBrowser = {
     sameProcessAsFrameLoader,
     skipAnimation,
     skipBackgroundNotify,
     triggeringPrincipal,
     userContextId,
     recordExecution,
     replayExecution,
   } = {}) {
-    // all callers of addTab that pass a params object need to pass
-    // a valid triggeringPrincipal.
-    if (!triggeringPrincipal) {
-      throw new Error("Required argument triggeringPrincipal missing within addTab");
-    }
-
-
     // if we're adding tabs, we're past interrupt mode, ditch the owner
     if (this.selectedTab.owner) {
       this.selectedTab.owner = null;
     }
 
     // Find the tab that opened this one, if any. This is used for
     // determining positioning, and inherited attributes such as the
     // user context ID.
@@ -2855,19 +2819,17 @@ window._gBrowser = {
     this._removingTabs.push(aTab);
     this._visibleTabs = null; // invalidate cache
 
     // Invalidate hovered tab state tracking for this closing tab.
     if (this.tabContainer._hoveredTab == aTab)
       aTab._mouseleave();
 
     if (newTab)
-      this.addTrustedTab(BROWSER_NEW_TAB_URL, {
-        skipAnimation: true,
-      });
+      this.addTab(BROWSER_NEW_TAB_URL, { skipAnimation: true });
     else
       TabBarVisibility.update();
 
     // We're committed to closing the tab now.
     // Dispatch a notification.
     // We dispatch it before any teardown so that event listeners can
     // inspect the tab that's about to close.
     var evt = new CustomEvent("TabClose", { bubbles: true, detail: { adoptedBy: aAdoptedByTab } });
@@ -3632,17 +3594,17 @@ window._gBrowser = {
     if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
       params.pinned = true;
     }
 
     if (aTab.hasAttribute("usercontextid")) {
       // new tab must have the same usercontextid as the old one
       params.userContextId = aTab.getAttribute("usercontextid");
     }
-    let newTab = this.addWebTab("about:blank", params);
+    let newTab = this.addTab("about:blank", params);
     let newBrowser = this.getBrowserForTab(newTab);
 
     // Stop the about:blank load.
     newBrowser.stop();
     // Make sure it has a docshell.
     newBrowser.docShell;
 
     // We need to select the tab before calling swapBrowsersAndCloseOther
@@ -5309,32 +5271,20 @@ var TabContextMenu = {
   },
   createReopenInContainerMenu(event) {
     createUserContextMenu(event, {
       isContextMenu: true,
       excludeUserContextId: this.contextTab.getAttribute("usercontextid"),
     });
   },
   reopenInContainer(event) {
-    let userContextId = parseInt(event.target.getAttribute("data-usercontextid"));
-    /* Create a triggering principal that is able to load the new tab
-       For codebase principals that are about: chrome: or resource: we need system to load them.
-       Anything other than system principal needs to have the new userContextId.
-    */
-    let triggeringPrincipal = this.contextTab.linkedBrowser.contentPrincipal;
-    if (triggeringPrincipal.isNullPrincipal) {
-      triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({ userContextId });
-    } else if (triggeringPrincipal.isCodebasePrincipal) {
-      triggeringPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(triggeringPrincipal.URI, { userContextId });
-    }
     let newTab = gBrowser.addTab(this.contextTab.linkedBrowser.currentURI.spec, {
-      userContextId,
+      userContextId: parseInt(event.target.getAttribute("data-usercontextid")),
       pinned: this.contextTab.pinned,
       index: this.contextTab._tPos + 1,
-      triggeringPrincipal,
     });
 
     if (gBrowser.selectedTab == this.contextTab) {
       gBrowser.selectedTab = newTab;
     }
     if (this.contextTab.muted) {
       if (!newTab.muted) {
         newTab.toggleMuteAudio(this.contextTab.muteReason);
--- a/browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js
+++ b/browser/base/content/test/general/browser_beforeunload_duplicate_dialogs.js
@@ -40,17 +40,17 @@ add_task(async function closeLastTabInWi
   ok(newWin.closed, "Window should be closed.");
 });
 
 add_task(async function closeWindowWithMultipleTabsIncludingOneBeforeUnload() {
   Services.prefs.setBoolPref("browser.tabs.warnOnClose", false);
   let newWin = await promiseOpenAndLoadWindow({}, true);
   let firstTab = newWin.gBrowser.selectedTab;
   await promiseTabLoadEvent(firstTab, TEST_PAGE);
-  await promiseTabLoadEvent(BrowserTestUtils.addTab(newWin.gBrowser), "http://example.com/");
+  await promiseTabLoadEvent(newWin.gBrowser.addTab(), "http://example.com/");
   let windowClosedPromise = BrowserTestUtils.domWindowClosed(newWin);
   expectingDialog = true;
   newWin.BrowserTryToCloseWindow();
   await windowClosedPromise;
   ok(!expectingDialog, "There should have been a dialog.");
   ok(newWin.closed, "Window should be closed.");
   Services.prefs.clearUserPref("browser.tabs.warnOnClose");
 });
--- a/browser/base/content/test/general/browser_bug462673.js
+++ b/browser/base/content/test/general/browser_bug462673.js
@@ -15,17 +15,17 @@ add_task(async function() {
 
 add_task(async function() {
   var win = openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", "chrome,all,dialog=no");
   await SimpleTest.promiseFocus(win);
 
   let tab = win.gBrowser.tabContainer.firstChild;
   await promiseTabLoadEvent(tab, getRootDirectory(gTestPath) + "test_bug462673.html");
 
-  var newTab = BrowserTestUtils.addTab(win.gBrowser);
+  var newTab = win.gBrowser.addTab();
   var newBrowser = newTab.linkedBrowser;
   win.gBrowser.removeTab(tab);
   ok(!win.closed, "Window stays open");
   if (!win.closed) {
     is(win.gBrowser.tabContainer.childElementCount, 1, "Window has one tab");
     is(win.gBrowser.browsers.length, 1, "Window has one browser");
     is(win.gBrowser.selectedTab, newTab, "Remaining tab is selected");
     is(win.gBrowser.selectedBrowser, newBrowser, "Browser for remaining tab is selected");
--- a/browser/base/content/test/general/browser_bug963945.js
+++ b/browser/base/content/test/general/browser_bug963945.js
@@ -5,17 +5,17 @@
 /*
  * This test ensures the about:addons tab is only
  * opened one time when in private browsing.
  */
 
 add_task(async function test() {
   let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
 
-  let tab = win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser, "about:addons");
+  let tab = win.gBrowser.selectedTab = win.gBrowser.addTab("about:addons");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await promiseWaitForFocus(win);
 
   EventUtils.synthesizeKey("a", { ctrlKey: true, shiftKey: true }, win);
 
   is(win.gBrowser.tabs.length, 2, "about:addons tab was re-focused.");
   is(win.gBrowser.currentURI.spec, "about:addons", "Addons tab was opened.");
 
--- a/browser/base/content/test/general/browser_tab_dragdrop2.js
+++ b/browser/base/content/test/general/browser_tab_dragdrop2.js
@@ -12,17 +12,17 @@ add_task(async function() {
   let args = "chrome,all,dialog=no";
   let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", args, URI);
 
   // Wait until the tests were run.
   await promiseTestsDone(win);
   ok(true, "tests succeeded");
 
   // Create a second tab so that we can move the original one out.
-  BrowserTestUtils.addTab(win.gBrowser, "about:blank", {skipAnimation: true});
+  win.gBrowser.addTab("about:blank", {skipAnimation: true});
 
   // Tear off the original tab.
   let browser = win.gBrowser.selectedBrowser;
   let tabClosed = promiseWaitForEvent(browser, "pagehide", true);
   let win2 = win.gBrowser.replaceTabWithWindow(win.gBrowser.tabs[0]);
 
   // Add a 'TestsDone' event listener to ensure that the docShells is properly
   // swapped to the new window instead of the page being loaded again. If this
--- a/browser/base/content/test/general/browser_trackingUI_5.js
+++ b/browser/base/content/test/general/browser_trackingUI_5.js
@@ -92,17 +92,17 @@ add_task(async function testExceptionAdd
   let tabReloadPromise = promiseTabLoadEvent(tab);
   clickButton("#tracking-action-unblock");
   is(identityPopupState(), "closed", "foobar");
 
   await tabReloadPromise;
   testTrackingPageUnblocked();
 
   info("Test that the exception is remembered across tabs in the same private window");
-  tab = browser.selectedTab = BrowserTestUtils.addTab(browser);
+  tab = browser.selectedTab = browser.addTab();
 
   info("Load a test page containing tracking elements");
   await promiseTabLoadEvent(tab, TRACKING_PAGE);
   testTrackingPageUnblocked();
 
   await promiseWindowClosed(privateWin);
 });
 
--- a/browser/base/content/test/general/browser_utilityOverlay.js
+++ b/browser/base/content/test/general/browser_utilityOverlay.js
@@ -85,17 +85,17 @@ function test_getTopWin() {
 function test_getBoolPref() {
   is(getBoolPref("browser.search.openintab", false), false, "getBoolPref");
   is(getBoolPref("this.pref.doesnt.exist", true), true, "getBoolPref fallback");
   is(getBoolPref("this.pref.doesnt.exist", false), false, "getBoolPref fallback #2");
   runNextTest();
 }
 
 function test_openNewTabWith() {
-  openNewTabWith("http://example.com/", null, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});
+  openNewTabWith("http://example.com/");
   let tab = gBrowser.selectedTab = gBrowser.tabs[1];
   BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
     is(tab.linkedBrowser.currentURI.spec, "http://example.com/", "example.com loaded");
     gBrowser.removeCurrentTab();
     runNextTest();
   });
 }
 
--- a/browser/base/content/test/metaTags/browser_meta_tags.js
+++ b/browser/base/content/test/metaTags/browser_meta_tags.js
@@ -27,17 +27,17 @@ add_task(async function test_metadata() 
  * make sure the extra tab does not cause the debounce logic to be skipped. If
  * incorrectly skipped, the updated metadata would not include the delayed meta.
  */
 add_task(async function multiple_tabs() {
   const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PATH);
 
   // Add a background tab to cause another page to load *without* putting the
   // desired URL in a background tab, which results in its timers being throttled.
-  BrowserTestUtils.addTab(gBrowser);
+  gBrowser.addTab();
 
   // Wait until places has stored the page info
   const pageInfo = await waitForPageInfo(TEST_PATH);
   is(pageInfo.description, "og:description", "got the correct description");
   is(pageInfo.previewImageURL.href, "https://test.com/og-image-secure-url.jpg", "got the correct preview image");
 
   BrowserTestUtils.removeTab(tab);
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
--- a/browser/base/content/test/performance/head.js
+++ b/browser/base/content/test/performance/head.js
@@ -298,20 +298,17 @@ function computeMaxTabCount() {
  *        How many about:blank tabs to open.
  */
 async function createTabs(howMany) {
   let uris = [];
   while (howMany--) {
     uris.push("about:blank");
   }
 
-  gBrowser.loadTabs(uris, {
-    inBackground: true,
-    triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-  });
+  gBrowser.loadTabs(uris, { inBackground: true });
 
   await BrowserTestUtils.waitForCondition(() => {
     return Array.from(gBrowser.tabs).every(tab => tab._fullyOpen);
   });
 }
 
 /**
  * Removes all of the tabs except the originally selected
--- a/browser/base/content/test/referrer/head.js
+++ b/browser/base/content/test/referrer/head.js
@@ -205,17 +205,17 @@ function referrerTestCaseLoaded(aTestNum
                              REFERRER_POLICYSERVER_URL_ATTRIBUTE;
   let url = test.fromScheme + server +
             "?scheme=" + escape(test.toScheme) +
             "&policy=" + escape(test.policy || "") +
             "&rel=" + escape(test.rel || "") +
             "&cross=" + escape(test.cross || "");
   let browser = gTestWindow.gBrowser;
   return BrowserTestUtils.openNewForegroundTab(browser, () => {
-    browser.selectedTab = BrowserTestUtils.addTab(browser, url, aParams);
+    browser.selectedTab = browser.addTab(url, aParams);
   }, false, true);
 }
 
 /**
  * Checks the result of the referrer test, and moves on to the next test.
  * @param aTestNumber The test number - 0, 1, 2, ...
  * @param aNewWindow The new window where the referrer target opened, or null.
  * @param aNewTab The new tab where the referrer target opened, or null.
--- a/browser/base/content/test/tabs/browser_new_tab_insert_position.js
+++ b/browser/base/content/test/tabs/browser_new_tab_insert_position.js
@@ -149,20 +149,17 @@ async function doTest(aInsertRelatedAfte
   verifyTabState(newState);
 
   // Bug 1442679 - Test bulk opening with loadTabs loads the tabs in order
 
   let loadPromises = Promise.all(bulkLoad.map(url => BrowserTestUtils.waitForNewTab(gBrowser, url, false, true)));
   // loadTabs will insertAfterCurrent
   let nextTab = aInsertAfterCurrent ? gBrowser.selectedTab._tPos + 1 : gBrowser.tabs.length;
 
-  gBrowser.loadTabs(bulkLoad, {
-    inBackground: true,
-    triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-  });
+  gBrowser.loadTabs(bulkLoad, { inBackground: true });
   await loadPromises;
   for (let i = nextTab, j = 0; j < bulkLoad.length; i++, j++) {
     is(gBrowser.tabs[i].linkedBrowser.currentURI.spec, bulkLoad[j], `bulkLoad tab pos ${i} matched`);
   }
 
   // Now we want to test that positioning remains correct after a session restore.
 
   // Restore pre-test state so we can restore and test tab ordering.
--- a/browser/base/content/test/tabs/browser_pinnedTabs_closeByKeyboard.js
+++ b/browser/base/content/test/tabs/browser_pinnedTabs_closeByKeyboard.js
@@ -16,17 +16,17 @@ function test() {
        "menu_close should always have key_close set");
   }
 
   let unpinnedTab = gBrowser.selectedTab;
   ok(!unpinnedTab.pinned, "We should have started with a regular tab selected");
 
   testState(false);
 
-  let pinnedTab = BrowserTestUtils.addTab(gBrowser);
+  let pinnedTab = gBrowser.addTab();
   gBrowser.pinTab(pinnedTab);
 
   // Just pinning the tab shouldn't change the key state.
   testState(false);
 
   // Test key state after selecting a tab.
   gBrowser.selectedTab = pinnedTab;
   testState(true);
@@ -40,17 +40,17 @@ function test() {
   // Test the key state after un/pinning the tab.
   gBrowser.unpinTab(pinnedTab);
   testState(false);
 
   gBrowser.pinTab(pinnedTab);
   testState(true);
 
   // Test that accel+w in a pinned tab selects the next tab.
-  let pinnedTab2 = BrowserTestUtils.addTab(gBrowser);
+  let pinnedTab2 = gBrowser.addTab();
   gBrowser.pinTab(pinnedTab2);
   gBrowser.selectedTab = pinnedTab;
 
   EventUtils.synthesizeKey("w", { accelKey: true });
   is(gBrowser.tabs.length, 3, "accel+w in a pinned tab didn't close it");
   is(gBrowser.selectedTab, unpinnedTab, "accel+w in a pinned tab selected the first unpinned tab");
 
   // Test the key state after removing the tab.
--- a/browser/base/content/test/tabs/browser_positional_attributes.js
+++ b/browser/base/content/test/tabs/browser_positional_attributes.js
@@ -1,43 +1,41 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var tabs = [];
 
-function addTab(aURL, done) {
-  tabs.push(BrowserTestUtils.addTab(gBrowser, aURL, {
-    skipAnimation: true,
-  }, done));
+function addTab(aURL) {
+  tabs.push(gBrowser.addTab(aURL, {skipAnimation: true}));
 }
 
 function switchTab(index) {
   return BrowserTestUtils.switchTab(gBrowser, gBrowser.tabs[index]);
 }
 
 function testAttrib(tabIndex, attrib, expected) {
   is(gBrowser.tabs[tabIndex].hasAttribute(attrib), expected,
      `tab #${tabIndex} should${expected ? "" : "n't"} have the ${attrib} attribute`);
 }
 
 add_task(async function setup() {
   is(gBrowser.tabs.length, 1, "one tab is open initially");
 
-  await new Promise(r => addTab("http://mochi.test:8888/#0", r));
-  await new Promise(r => addTab("http://mochi.test:8888/#1", r));
-  await new Promise(r => addTab("http://mochi.test:8888/#2", r));
-  await new Promise(r => addTab("http://mochi.test:8888/#3", r));
-
-  is(gBrowser.tabs.length, 5, "five tabs are open after setup");
+  addTab("http://mochi.test:8888/#0");
+  addTab("http://mochi.test:8888/#1");
+  addTab("http://mochi.test:8888/#2");
+  addTab("http://mochi.test:8888/#3");
 });
 
 // Add several new tabs in sequence, hiding some, to ensure that the
 // correct attributes get set
 add_task(async function test() {
+  await switchTab(0);
+
   testAttrib(0, "first-visible-tab", true);
   testAttrib(4, "last-visible-tab", true);
   testAttrib(0, "visuallyselected", true);
   testAttrib(0, "beforeselected-visible", false);
 
   await switchTab(2);
 
   testAttrib(2, "visuallyselected", true);
--- a/browser/base/content/test/trackingUI/browser_trackingUI_animation.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_animation.js
@@ -9,17 +9,17 @@ const TP_PREF = "privacy.trackingprotect
 const ANIMATIONS_PREF = "toolkit.cosmeticAnimations.enabled";
 
 // Test that the shield icon animation can be controlled by the cosmetic
 // animations pref and that one of the icons is visible in each case.
 add_task(async function testShieldAnimation() {
   await UrlClassifierTestUtils.addTestTrackers();
   Services.prefs.setBoolPref(TP_PREF, true);
 
-  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
+  let tab = gBrowser.selectedTab = gBrowser.addTab();
 
   let animationIcon = document.getElementById("tracking-protection-icon-animatable-image");
   let noAnimationIcon = document.getElementById("tracking-protection-icon");
 
   Services.prefs.setBoolPref(ANIMATIONS_PREF, true);
   await promiseTabLoadEvent(tab, TRACKING_PAGE);
   ok(BrowserTestUtils.is_hidden(noAnimationIcon), "the default icon is hidden when animations are enabled");
   ok(BrowserTestUtils.is_visible(animationIcon), "the animated icon is shown when animations are enabled");
--- a/browser/base/content/test/trackingUI/browser_trackingUI_state.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_state.js
@@ -226,17 +226,17 @@ async function testTrackingProtectionDis
   await promiseTabLoadEvent(tab, TRACKING_PAGE);
   testTrackingPageUnblocked();
 }
 
 add_task(async function testNormalBrowsing() {
   await UrlClassifierTestUtils.addTestTrackers();
 
   tabbrowser = gBrowser;
-  let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
+  let tab = tabbrowser.selectedTab = tabbrowser.addTab();
 
   TrackingProtection = gBrowser.ownerGlobal.TrackingProtection;
   ok(TrackingProtection, "TP is attached to the browser window");
   is(TrackingProtection.enabled, Services.prefs.getBoolPref(PREF),
      "TP.enabled is based on the original pref value");
 
   Services.prefs.setBoolPref(PREF, true);
   ok(TrackingProtection.enabled, "TP is enabled after setting the pref");
@@ -247,17 +247,17 @@ add_task(async function testNormalBrowsi
   ok(!TrackingProtection.enabled, "TP is disabled after setting the pref");
 
   await testTrackingProtectionDisabled(tab);
 });
 
 add_task(async function testPrivateBrowsing() {
   let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
   tabbrowser = privateWin.gBrowser;
-  let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
+  let tab = tabbrowser.selectedTab = tabbrowser.addTab();
 
   TrackingProtection = tabbrowser.ownerGlobal.TrackingProtection;
   ok(TrackingProtection, "TP is attached to the private window");
   is(TrackingProtection.enabled, Services.prefs.getBoolPref(PB_PREF),
      "TP.enabled is based on the pb pref value");
 
   Services.prefs.setBoolPref(PB_PREF, true);
   ok(TrackingProtection.enabled, "TP is enabled after setting the pref");
--- a/browser/base/content/test/urlbar/browser_URLBarSetURI.js
+++ b/browser/base/content/test/urlbar/browser_URLBarSetURI.js
@@ -62,17 +62,17 @@ var tests = [
       next();
     });
   }
 ];
 
 function loadTabInWindow(win, callback) {
   info("Loading tab");
   let url = "http://user:pass@example.com/";
-  let tab = win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser, url);
+  let tab = win.gBrowser.selectedTab = win.gBrowser.addTab(url);
   BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url).then(() => {
     info("Tab loaded");
     is(win.gURLBar.textValue, "example.com", "URL bar had user/pass stripped initially");
     callback(tab);
   }, true);
 }
 
 function openToolbarCustomizationUI(aCallback, aBrowserWin) {
--- a/browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
+++ b/browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
@@ -157,17 +157,17 @@ function get_test_function_for_localhost
     // check pref value
     let prefValue = Services.prefs.getBoolPref(pref);
     is(prefValue, !isPrivate, "Pref should have the correct state.");
 
     await docLoadPromise;
     browser.removeTab(tab);
 
     // Now try again with the pref set.
-    tab = browser.selectedTab = BrowserTestUtils.addTab(browser, "about:blank");
+    tab = browser.selectedTab = browser.addTab("about:blank");
     await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
     // In a private window, the notification should appear again.
     await runURLBarSearchTest({
       valueToOpen: hostName,
       expectSearch: isPrivate,
       expectNotification: isPrivate,
       aWindow: win,
     });
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -207,19 +207,16 @@ function openTrustedLinkIn(url, where, a
 function openWebLinkIn(url, where, params) {
   if (!params) {
     params = {};
   }
 
   if (!params.triggeringPrincipal) {
     params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({});
   }
-  if (Services.scriptSecurityManager.isSystemPrincipal(params.triggeringPrincipal)) {
-    throw new Error("System principal should never be passed into openWebLinkIn()");
-  }
 
   openUILinkIn(url, where, params);
 }
 
 /* openUILinkIn opens a URL in a place specified by the parameter |where|.
  *
  * |where| can be:
  *  "current"     current tab            (if there aren't any browser windows, then in a new window instead)
@@ -254,18 +251,17 @@ function openWebLinkIn(url, where, param
  *   userContextId        (unsigned int)
  *   targetBrowser        (XUL browser)
  */
 function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) {
   var params;
 
   if (arguments.length == 3 && typeof arguments[2] == "object") {
     params = aAllowThirdPartyFixup;
-  }
-  if (!params || !params.triggeringPrincipal) {
+  } else {
     throw new Error("Required argument triggeringPrincipal missing within openUILinkIn");
   }
 
   params.fromChrome = true;
 
   openLinkIn(url, where, params);
 }
 
--- a/browser/components/extensions/parent/ext-browser.js
+++ b/browser/components/extensions/parent/ext-browser.js
@@ -49,21 +49,17 @@ const getSender = (extension, target, se
 
 // Used by Extension.jsm
 global.tabGetSender = getSender;
 
 /* eslint-disable mozilla/balanced-listeners */
 extensions.on("uninstalling", (msg, extension) => {
   if (extension.uninstallURL) {
     let browser = windowTracker.topWindow.gBrowser;
-    browser.addTab(extension.uninstallURL, {
-      disallowInheritPrincipal: true,
-      relatedToCurrent: true,
-      triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
-    });
+    browser.addTab(extension.uninstallURL, {relatedToCurrent: true});
   }
 });
 
 extensions.on("page-shutdown", (type, context) => {
   if (context.viewType == "tab") {
     if (context.extension.id !== context.xulBrowser.contentPrincipal.addonId) {
       // Only close extension tabs.
       // This check prevents about:addons from closing when it contains a
--- a/browser/components/extensions/parent/ext-tabs.js
+++ b/browser/components/extensions/parent/ext-tabs.js
@@ -522,18 +522,28 @@ this.tabs = class extends ExtensionAPI {
                 resolve(window);
               };
               Services.obs.addObserver(obs, "browser-delayed-startup-finished");
             } else {
               resolve(window);
             }
           }).then(window => {
             let url;
-            let principal = context.principal;
+
+            if (createProperties.url !== null) {
+              url = context.uri.resolve(createProperties.url);
 
+              if (!context.checkLoadURL(url, {dontReportErrors: true})) {
+                return Promise.reject({message: `Illegal URL: ${url}`});
+              }
+
+              if (createProperties.openInReaderMode) {
+                url = `about:reader?url=${encodeURIComponent(url)}`;
+              }
+            }
 
             if (createProperties.cookieStoreId && !extension.hasPermission("cookies")) {
               return Promise.reject({message: `No permission for cookieStoreId: ${createProperties.cookieStoreId}`});
             }
 
             let options = {};
             if (createProperties.cookieStoreId) {
               if (!global.isValidCookieStoreId(createProperties.cookieStoreId)) {
@@ -554,43 +564,27 @@ this.tabs = class extends ExtensionAPI {
                 if (!containerId) {
                   return Promise.reject({message: `No cookie store exists with ID ${createProperties.cookieStoreId}`});
                 }
 
                 options.userContextId = containerId;
               }
             }
 
-            if (createProperties.url !== null) {
-              url = context.uri.resolve(createProperties.url);
-
-              if (!context.checkLoadURL(url, {dontReportErrors: true})) {
-                return Promise.reject({message: `Illegal URL: ${url}`});
-              }
-
-              if (createProperties.openInReaderMode) {
-                url = `about:reader?url=${encodeURIComponent(url)}`;
-              }
-            } else {
-              url = window.BROWSER_NEW_TAB_URL;
-            }
             // Only set disallowInheritPrincipal on non-discardable urls as it
             // will override creating a lazy browser.  Setting triggeringPrincipal
             // will ensure other cases are handled, but setting it may prevent
             // creating about and data urls.
             let discardable = url && !url.startsWith("about:");
             if (!discardable) {
               // Make sure things like about:blank and data: URIs never inherit,
               // and instead always get a NullPrincipal.
               options.disallowInheritPrincipal = true;
-              // Falling back to codebase here as about: requires it, however is safe.
-              principal = Services.scriptSecurityManager.createCodebasePrincipal(Services.io.newURI(url), {
-                userContextId: options.userContextId,
-                privateBrowsingId: PrivateBrowsingUtils.isBrowserPrivate(window.gBrowser) ? 1 : 0,
-              });
+            } else {
+              options.triggeringPrincipal = context.principal;
             }
 
             tabListener.initTabReady();
             let currentTab = window.gBrowser.selectedTab;
 
             if (createProperties.openerTabId !== null) {
               options.ownerTab = tabTracker.getTab(createProperties.openerTabId);
               options.openerBrowser = options.ownerTab.linkedBrowser;
@@ -619,24 +613,23 @@ this.tabs = class extends ExtensionAPI {
               if (!discardable) {
                 return Promise.reject({message: `Cannot create a discarded new tab or "about" urls.`});
               }
               options.createLazyBrowser = true;
             } else if (createProperties.title) {
               return Promise.reject({message: `Title may only be set for discarded tabs.`});
             }
 
-            options.triggeringPrincipal = principal;
-            let nativeTab = window.gBrowser.addTab(url, options);
+            let nativeTab = window.gBrowser.addTab(url || window.BROWSER_NEW_TAB_URL, options);
             if (createProperties.discarded) {
               SessionStore.setTabState(nativeTab, {
                 entries: [{
                   url: url,
                   title: options.title,
-                  triggeringPrincipal_base64: Utils.serializePrincipal(principal),
+                  triggeringPrincipal_base64: Utils.serializePrincipal(context.principal),
                 }],
               });
             }
 
             if (active) {
               window.gBrowser.selectedTab = nativeTab;
               if (!url) {
                 window.focusAndSelectUrlBar();
--- a/browser/components/extensions/test/browser/browser-common.ini
+++ b/browser/components/extensions/test/browser/browser-common.ini
@@ -161,17 +161,16 @@ skip-if = !e10s || !crashreporter # the 
 [browser_ext_slow_script.js]
 skip-if = !e10s || debug || asan
 [browser_ext_tab_runtimeConnect.js]
 [browser_ext_tabs_audio.js]
 [browser_ext_tabs_captureTab.js]
 [browser_ext_tabs_captureVisibleTab.js]
 [browser_ext_tabs_create.js]
 skip-if = os == "linux" && debug && bits == 32 # Bug 1350189
-[browser_ext_tabs_create_url.js]
 [browser_ext_tabs_create_invalid_url.js]
 [browser_ext_tabs_detectLanguage.js]
 [browser_ext_tabs_discard.js]
 skip-if = !e10s
 [browser_ext_tabs_discarded.js]
 [browser_ext_tabs_duplicate.js]
 [browser_ext_tabs_events.js]
 [browser_ext_tabs_executeScript.js]
--- a/browser/components/extensions/test/browser/browser_ext_tabs_create.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_create.js
@@ -170,16 +170,67 @@ add_task(async function test_create_opti
 
   await extension.startup();
   await extension.awaitFinish("tabs.create");
   await extension.unload();
 
   BrowserTestUtils.removeTab(tab);
 });
 
+add_task(async function test_urlbar_focus() {
+  const extension = ExtensionTestUtils.loadExtension({
+    background() {
+      browser.tabs.onUpdated.addListener(function onUpdated(_, info) {
+        if (info.status === "complete") {
+          browser.test.sendMessage("complete");
+          browser.tabs.onUpdated.removeListener(onUpdated);
+        }
+      });
+      browser.test.onMessage.addListener(async (cmd, ...args) => {
+        const result = await browser.tabs[cmd](...args);
+        browser.test.sendMessage("result", result);
+      });
+    },
+  });
+
+  await extension.startup();
+
+  // Test content is focused after opening a regular url
+  extension.sendMessage("create", {url: "https://example.com"});
+  const [tab1] = await Promise.all([
+    extension.awaitMessage("result"),
+    extension.awaitMessage("complete"),
+  ]);
+
+  is(document.activeElement.tagName, "browser", "Content focused after opening a web page");
+
+  extension.sendMessage("remove", tab1.id);
+  await extension.awaitMessage("result");
+
+  // Test urlbar is focused after opening an empty tab
+  extension.sendMessage("create", {});
+  const tab2 = await extension.awaitMessage("result");
+
+  const active = document.activeElement;
+  info(`Active element: ${active.tagName}, id: ${active.id}, class: ${active.className}`);
+
+  const parent = active.parentNode;
+  info(`Parent element: ${parent.tagName}, id: ${parent.id}, class: ${parent.className}`);
+
+  info(`After opening an empty tab, gURLBar.focused: ${gURLBar.focused}`);
+
+  is(active.tagName, "html:input", "Input element focused");
+  ok(active.classList.contains("urlbar-input"), "Urlbar focused");
+
+  extension.sendMessage("remove", tab2.id);
+  await extension.awaitMessage("result");
+
+  await extension.unload();
+});
+
 add_task(async function test_create_with_popup() {
   const extension = ExtensionTestUtils.loadExtension({
     async background() {
       let normalWin = await browser.windows.create();
       let lastFocusedNormalWin = await browser.windows.getLastFocused({});
       browser.test.assertEq(lastFocusedNormalWin.id, normalWin.id, "The normal window is the last focused window.");
       let popupWin = await browser.windows.create({type: "popup"});
       let lastFocusedPopupWin = await browser.windows.getLastFocused({});
deleted file mode 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_create_url.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(async function test_urlbar_focus() {
-  const extension = ExtensionTestUtils.loadExtension({
-    background() {
-      browser.tabs.onUpdated.addListener(function onUpdated(_, info) {
-        if (info.status === "complete") {
-          browser.test.sendMessage("complete");
-          browser.tabs.onUpdated.removeListener(onUpdated);
-        }
-      });
-      browser.test.onMessage.addListener(async (cmd, ...args) => {
-        const result = await browser.tabs[cmd](...args);
-        browser.test.sendMessage("result", result);
-      });
-    },
-  });
-
-  await extension.startup();
-
-  // Test content is focused after opening a regular url
-  extension.sendMessage("create", {url: "https://example.com"});
-  const [tab1] = await Promise.all([
-    extension.awaitMessage("result"),
-    extension.awaitMessage("complete"),
-  ]);
-
-  is(document.activeElement.tagName, "browser", "Content focused after opening a web page");
-
-  extension.sendMessage("remove", tab1.id);
-  await extension.awaitMessage("result");
-
-  // Test urlbar is focused after opening an empty tab
-  extension.sendMessage("create", {});
-  const tab2 = await extension.awaitMessage("result");
-
-  const active = document.activeElement;
-  info(`Active element: ${active.tagName}, id: ${active.id}, class: ${active.className}`);
-
-  const parent = active.parentNode;
-  info(`Parent element: ${parent.tagName}, id: ${parent.id}, class: ${parent.className}`);
-
-  info(`After opening an empty tab, gURLBar.focused: ${gURLBar.focused}`);
-
-
-  is(active.tagName, "html:input", "Input element focused");
-  ok(active.classList.contains("urlbar-input"), "Urlbar focused");
-
-  extension.sendMessage("remove", tab2.id);
-  await extension.awaitMessage("result");
-
-  await extension.unload();
-});
--- a/browser/components/migration/tests/marionette/test_refresh_firefox.py
+++ b/browser/components/migration/tests/marionette/test_refresh_firefox.py
@@ -166,19 +166,17 @@ class TestFirefoxRefresh(MarionetteTestC
                     resolve();
                   }
                 });
               }
             }
           });
           let expectedTabs = new Set();
           for (let url of expectedURLs) {
-            expectedTabs.add(gBrowser.addTab(url, {
-              triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-            }));
+            expectedTabs.add(gBrowser.addTab(url));
           }
           // Close any other tabs that might be open:
           let allTabs = Array.from(gBrowser.tabs);
           for (let tab of allTabs) {
             if (!expectedTabs.has(tab)) {
               gBrowser.removeTab(tab);
             }
           }
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2350,17 +2350,17 @@ BrowserGlue.prototype = {
 
       const openTab = async (URI) => {
         let tab;
         if (!win) {
           win = await this._openURLInNewWindow(URI.uri);
           let tabs = win.gBrowser.tabs;
           tab = tabs[tabs.length - 1];
         } else {
-          tab = win.gBrowser.addWebTab(URI.uri);
+          tab = win.gBrowser.addTab(URI.uri);
         }
         tab.setAttribute("attention", true);
         return tab;
       };
 
       const firstTab = await openTab(URIs[0]);
       await Promise.all(URIs.slice(1).map(URI => openTab(URI)));
 
@@ -2430,17 +2430,17 @@ BrowserGlue.prototype = {
       imageURL = "chrome://branding/content/icon64.png";
     }
     let win = BrowserWindowTracker.getTopWindow({private: false});
     if (!win) {
       win = await this._openURLInNewWindow(url);
       let tabs = win.gBrowser.tabs;
       tab = tabs[tabs.length - 1];
     } else {
-      tab = win.gBrowser.addWebTab(url);
+      tab = win.gBrowser.addTab(url);
     }
     tab.setAttribute("attention", true);
     let clickCallback = (subject, topic, data) => {
       if (topic != "alertclickcallback")
         return;
       win.gBrowser.selectedTab = tab;
     };
 
@@ -2463,17 +2463,17 @@ BrowserGlue.prototype = {
     let clickCallback = async (subject, topic, data) => {
       if (topic != "alertclickcallback")
         return;
       let url = await FxAccounts.config.promiseManageDevicesURI("device-connected-notification");
       let win = BrowserWindowTracker.getTopWindow({private: false});
       if (!win) {
         this._openURLInNewWindow(url);
       } else {
-        win.gBrowser.addWebTab(url);
+        win.gBrowser.addTab(url);
       }
     };
 
     try {
       this.AlertsService.showAlertNotification(null, title, body, true, null, clickCallback);
     } catch (ex) {
       Cu.reportError("Error notifying of a new Sync device: " + ex);
     }
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_aboutSessionRestore.js
@@ -4,17 +4,17 @@
 
 // This test checks that the session restore button from about:sessionrestore
 // is disabled in private mode
 add_task(async function testNoSessionRestoreButton() {
   // Opening, then closing, a private window shouldn't create session data.
   (await BrowserTestUtils.openNewBrowserWindow({private: true})).close();
 
   let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
-  let tab = BrowserTestUtils.addTab(win.gBrowser, "about:sessionrestore");
+  let tab = win.gBrowser.addTab("about:sessionrestore");
   let browser = tab.linkedBrowser;
 
   await BrowserTestUtils.browserLoaded(browser);
 
   await ContentTask.spawn(browser, null, async function() {
     Assert.ok(content.document.getElementById("errorTryAgain").disabled,
       "The Restore about:sessionrestore button should be disabled");
   });
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
@@ -56,17 +56,17 @@ function getStorageEntryCount(device, go
 
 function get_cache_for_private_window() {
   let win = whenNewWindowLoaded({private: true}, function() {
 
     executeSoon(function() {
 
       ok(true, "The private window got loaded");
 
-      let tab = BrowserTestUtils.addTab(win.gBrowser, "http://example.org");
+      let tab = win.gBrowser.addTab("http://example.org");
       win.gBrowser.selectedTab = tab;
       let newTabBrowser = win.gBrowser.getBrowserForTab(tab);
 
       BrowserTestUtils.browserLoaded(newTabBrowser).then(function() {
         executeSoon(function() {
 
           getStorageEntryCount("private", function(nrEntriesP) {
             ok(nrEntriesP >= 1, "Memory cache reports some entries from example.org domain");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js
@@ -154,17 +154,17 @@ async function assignCookies(aBrowser, a
   await ContentTask.spawn(tabInfo.browser, aCookieValue, async function(value) {
     content.document.cookie = value;
   });
 
   BrowserTestUtils.removeTab(tabInfo.tab);
 }
 
 async function openTab(aBrowser, aURL) {
-  let tab = BrowserTestUtils.addTab(aBrowser, aURL);
+  let tab = aBrowser.addTab(aURL);
 
   // Select tab and make sure its browser is focused.
   aBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = aBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt.js
@@ -6,17 +6,17 @@
 // control inside the private browsing mode.
 
 add_task(async function test() {
   const testPageURL = "https://example.com/browser/" +
     "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_geoprompt_page.html";
 
   function checkGeolocation(aPrivateMode, aWindow) {
     return (async function() {
-      aWindow.gBrowser.selectedTab = BrowserTestUtils.addTab(aWindow.gBrowser, testPageURL);
+      aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab(testPageURL);
       await BrowserTestUtils.browserLoaded(aWindow.gBrowser.selectedBrowser);
 
       let notification = aWindow.PopupNotifications.getNotification("geolocation");
 
       // Wait until the notification is available.
       while (!notification) {
         await new Promise(resolve => { executeSoon(resolve); });
         notification = aWindow.PopupNotifications.getNotification("geolocation");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
@@ -4,17 +4,17 @@
 
  add_task(async function test() {
   requestLongerTimeout(2);
   const page1 = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/" +
                 "browser_privatebrowsing_localStorage_page1.html";
 
   let win = await BrowserTestUtils.openNewBrowserWindow({private: true});
 
-  win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser, page1);
+  win.gBrowser.selectedTab = win.gBrowser.addTab(page1);
   let browser = win.gBrowser.selectedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
 
   browser.loadURI(
     "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/" +
     "browser_privatebrowsing_localStorage_page2.html");
   await BrowserTestUtils.browserLoaded(browser);
 
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after.js
@@ -10,25 +10,25 @@
 // Step 2: Load the same page in a non-private tab, ensuring that the storage instance reports only one item
 //   existing.
 
 add_task(async function test() {
   let prefix = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/";
 
   // Step 1.
   let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
-  let privateBrowser = BrowserTestUtils.addTab(privateWin.gBrowser,
+  let privateBrowser = privateWin.gBrowser.addTab(
     prefix + "browser_privatebrowsing_localStorage_before_after_page.html").linkedBrowser;
   await BrowserTestUtils.browserLoaded(privateBrowser);
 
   is(privateBrowser.contentTitle, "1", "localStorage should contain 1 item");
 
   // Step 2.
   let win = await BrowserTestUtils.openNewBrowserWindow();
-  let browser = BrowserTestUtils.addTab(win.gBrowser,
+  let browser = win.gBrowser.addTab(
     prefix + "browser_privatebrowsing_localStorage_before_after_page2.html").linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
 
   is(browser.contentTitle, "null|0", "localStorage should contain 0 items");
 
   // Cleanup
   await BrowserTestUtils.closeWindow(privateWin);
   await BrowserTestUtils.closeWindow(win);
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_noSessionRestoreMenuOption.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_noSessionRestoreMenuOption.js
@@ -3,17 +3,17 @@
 /**
  * Tests that if we open a tab within a private browsing window, and then
  * close that private browsing window, that subsequent private browsing
  * windows do not allow the command for restoring the last session.
  */
 add_task(async function test_no_session_restore_menu_option() {
   let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
   ok(true, "The first private window got loaded");
-  BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
+  win.gBrowser.addTab("about:mozilla");
   await BrowserTestUtils.closeWindow(win);
 
   win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
   let srCommand = win.document.getElementById("Browser:RestoreLastSession");
   ok(srCommand, "The Session Restore command should exist");
   is(PrivateBrowsingUtils.isWindowPrivate(win), true,
      "PrivateBrowsingUtils should report the correct per-window private browsing status");
   is(srCommand.hasAttribute("disabled"), true,
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler.js
@@ -7,17 +7,17 @@
 // inside the private browsing mode.
 
 add_task(async function test() {
   let notificationValue = "Protocol Registration: web+testprotocol";
   let testURI = "https://example.com/browser/" +
     "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_protocolhandler_page.html";
 
   let doTest = async function(aIsPrivateMode, aWindow) {
-    let tab = aWindow.gBrowser.selectedTab = BrowserTestUtils.addTab(aWindow.gBrowser, testURI);
+    let tab = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab(testURI);
     await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
     let promiseFinished = PromiseUtils.defer();
     setTimeout(function() {
       let notificationBox = aWindow.gBrowser.getNotificationBox();
       let notification = notificationBox.getNotificationWithValue(notificationValue);
 
       if (aIsPrivateMode) {
--- a/browser/components/safebrowsing/content/test/browser_whitelisted.js
+++ b/browser/components/safebrowsing/content/test/browser_whitelisted.js
@@ -22,17 +22,17 @@ function testWhitelistedPage(window) {
   var getmeout_button = window.document.getElementById("getMeOutButton");
   var ignorewarning_button = window.document.getElementById("ignoreWarningButton");
   ok(!getmeout_button, "GetMeOut button not present");
   ok(!ignorewarning_button, "IgnoreWarning button not present");
 }
 
 add_task(async function testNormalBrowsing() {
   tabbrowser = gBrowser;
-  let tab = tabbrowser.selectedTab = BrowserTestUtils.addTab(tabbrowser);
+  let tab = tabbrowser.selectedTab = tabbrowser.addTab();
 
   info("Load a test page that's whitelisted");
   Services.prefs.setCharPref(PREF_WHITELISTED_HOSTNAMES, "example.com,www.ItIsaTrap.org,example.net");
   await promiseTabLoadEvent(tab, TEST_PAGE, "load");
   testWhitelistedPage(tab.ownerGlobal);
 
   info("Load a test page that's no longer whitelisted");
   Services.prefs.setCharPref(PREF_WHITELISTED_HOSTNAMES, "");
--- a/browser/components/search/test/browser_contextSearchTabPosition.js
+++ b/browser/components/search/test/browser_contextSearchTabPosition.js
@@ -28,18 +28,18 @@ add_task(async function test() {
       tabsLoadedDeferred.resolve();
     }
   }
 
   let container = gBrowser.tabContainer;
   container.addEventListener("TabOpen", tabAdded);
 
   BrowserTestUtils.addTab(gBrowser, "about:blank");
-  BrowserSearch.loadSearchFromContext("mozilla", Services.scriptSecurityManager.getSystemPrincipal());
-  BrowserSearch.loadSearchFromContext("firefox", Services.scriptSecurityManager.getSystemPrincipal());
+  BrowserSearch.loadSearchFromContext("mozilla");
+  BrowserSearch.loadSearchFromContext("firefox");
 
   // Wait for all the tabs to open.
   await tabsLoadedDeferred.promise;
 
   is(tabs[0], gBrowser.tabs[3], "blank tab has been pushed to the end");
   is(tabs[1], gBrowser.tabs[1], "first search tab opens next to the current tab");
   is(tabs[2], gBrowser.tabs[2], "second search tab opens next to the first search tab");
 
--- a/browser/components/search/test/browser_google_behavior.js
+++ b/browser/components/search/test/browser_google_behavior.js
@@ -88,17 +88,17 @@ async function testSearchEngine(engineDe
 
   let engineTests = [
     {
       name: "context menu search",
       searchURL: base + engineDetails.codes.context,
       run() {
         // Simulate a contextmenu search
         // FIXME: This is a bit "low-level"...
-        BrowserSearch._loadSearch("foo", false, "contextmenu", Services.scriptSecurityManager.getSystemPrincipal());
+        BrowserSearch.loadSearch("foo", false, "contextmenu");
       }
     },
     {
       name: "keyword search",
       searchURL: base + engineDetails.codes.keyword,
       run() {
         gURLBar.value = "? foo";
         gURLBar.focus();
--- a/browser/components/search/test/browser_searchEngine_behaviors.js
+++ b/browser/components/search/test/browser_searchEngine_behaviors.js
@@ -106,17 +106,17 @@ async function testSearchEngine(engineDe
 
   let engineTests = [
     {
       name: "context menu search",
       searchURL: base + engineDetails.codes.context,
       run() {
         // Simulate a contextmenu search
         // FIXME: This is a bit "low-level"...
-        BrowserSearch._loadSearch("foo", false, "contextmenu", Services.scriptSecurityManager.getSystemPrincipal());
+        BrowserSearch.loadSearch("foo", false, "contextmenu");
       }
     },
     {
       name: "keyword search",
       searchURL: base + engineDetails.codes.keyword,
       run() {
         gURLBar.value = "? foo";
         gURLBar.focus();
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -2426,22 +2426,19 @@ var SessionStoreInternal = {
       throw Components.Exception("Default view is not tracked", Cr.NS_ERROR_INVALID_ARG);
     }
     if (!aWindow.gBrowser) {
       throw Components.Exception("Invalid window object: no gBrowser", Cr.NS_ERROR_INVALID_ARG);
     }
 
     // Create a new tab.
     let userContextId = aTab.getAttribute("usercontextid");
-
-    let tabOptions = {
-      userContextId,
-      ...(aTab == aWindow.gBrowser.selectedTab ? {relatedToCurrent: true, ownerTab: aTab} : {})
-    };
-    let newTab = aWindow.gBrowser.addTrustedTab(null, tabOptions);
+    let newTab = aTab == aWindow.gBrowser.selectedTab ?
+      aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab, userContextId}) :
+      aWindow.gBrowser.addTab(null, {userContextId});
 
     // Start the throbber to pretend we're doing something while actually
     // waiting for data from the frame script.
     newTab.setAttribute("busy", "true");
 
     // Collect state before flushing.
     let tabState = TabState.collect(aTab, TAB_CUSTOM_VALUES.get(aTab));
 
@@ -2520,17 +2517,17 @@ var SessionStoreInternal = {
     }
 
     // fetch the data of closed tab, while removing it from the array
     let {state, pos} = this.removeClosedTabData(closedTabs, aIndex);
 
     // create a new tab
     let tabbrowser = aWindow.gBrowser;
     let tab = tabbrowser.selectedTab =
-      tabbrowser.addTrustedTab(null, {
+      tabbrowser.addTab(null, {
         index: pos,
         pinned: state.pinned,
         userContextId: state.userContextId,
       });
 
     // restore tab content
     this.restoreTab(tab, state);
 
@@ -3490,23 +3487,23 @@ var SessionStoreInternal = {
           activeIndex = Math.min(activeIndex, tabData.entries.length - 1);
           activeIndex = Math.max(activeIndex, 0);
           url = tabData.entries[activeIndex].url;
         }
 
         // Setting noInitialLabel is a perf optimization. Rendering tab labels
         // would make resizing the tabs more expensive as we're adding them.
         // Each tab will get its initial label set in restoreTab.
-        tab = tabbrowser.addTrustedTab(url,
-                                       { createLazyBrowser,
-                                         skipAnimation: true,
-                                         noInitialLabel: true,
-                                         userContextId,
-                                         skipBackgroundNotify: true,
-                                         bulkOrderedOpen: true });
+        tab = tabbrowser.addTab(url,
+                                { createLazyBrowser,
+                                  skipAnimation: true,
+                                  noInitialLabel: true,
+                                  userContextId,
+                                  skipBackgroundNotify: true,
+                                  bulkOrderedOpen: true });
 
         if (select) {
           let leftoverTab = tabbrowser.selectedTab;
           tabbrowser.selectedTab = tab;
           tabbrowser.removeTab(leftoverTab);
         }
       }
 
--- a/browser/components/sessionstore/content/aboutSessionRestore.js
+++ b/browser/components/sessionstore/content/aboutSessionRestore.js
@@ -259,17 +259,17 @@ function toggleRowChecked(aIx) {
   // we only disable the button when there's no cancel button.
   if (document.getElementById("errorCancel")) {
     document.getElementById("errorTryAgain").disabled = !gTreeData.some(isChecked);
   }
 }
 
 function restoreSingleTab(aIx, aShifted) {
   var tabbrowser = getBrowserWindow().gBrowser;
-  var newTab = tabbrowser.addWebTab();
+  var newTab = tabbrowser.addTab();
   var item = gTreeData[aIx];
 
   var tabState = gStateObject.windows[item.parent.ix]
                              .tabs[aIx - gTreeData.indexOf(item.parent) - 1];
   // ensure tab would be visible on the tabstrip.
   tabState.hidden = false;
   SessionStore.setTabState(newTab, JSON.stringify(tabState));
 
--- a/browser/components/sessionstore/test/browser_354894_perwindowpb.js
+++ b/browser/components/sessionstore/test/browser_354894_perwindowpb.js
@@ -158,17 +158,17 @@ let setupTest = async function(options, 
 
 /**
  * Loads a TEST_URLS into a browser window.
  *
  * @param win (Window)
  *        The browser window to load the tabs in
  */
 function injectTestTabs(win) {
-  let promises = TEST_URLS.map(url => BrowserTestUtils.addTab(win.gBrowser, url))
+  let promises = TEST_URLS.map(url => win.gBrowser.addTab(url))
                           .map(tab => BrowserTestUtils.browserLoaded(tab.linkedBrowser));
   return Promise.all(promises);
 }
 
 /**
  * Attempts to close a window via BrowserTryToCloseWindow so that
  * we get the browser-lastwindow-close-requested and
  * browser-lastwindow-close-granted observer notifications.
@@ -308,17 +308,17 @@ add_task(async function test_open_close_
     let popupPromise = BrowserTestUtils.waitForNewWindow();
     openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[0]);
     let popup = await popupPromise;
 
     let popup2Promise = BrowserTestUtils.waitForNewWindow();
     openDialog(location, "popup2", POPUP_FEATURES, TEST_URLS[1]);
     let popup2 = await popup2Promise;
 
-    BrowserTestUtils.addTab(popup2.gBrowser, TEST_URLS[0]);
+    popup2.gBrowser.addTab(TEST_URLS[0]);
 
     let closed = await closeWindowForRestoration(newWin);
     ok(closed, "Should be able to close the window");
 
     await BrowserTestUtils.closeWindow(popup2);
 
     newWin = await promiseNewWindowLoaded();
 
@@ -373,17 +373,17 @@ add_task(async function test_open_close_
 
     let closed = await closeWindowForRestoration(popup);
     ok(closed, "Should be able to close the window");
 
     popupPromise = BrowserTestUtils.waitForNewWindow();
     openDialog(location, "popup", POPUP_FEATURES, TEST_URLS[1]);
     popup = await popupPromise;
 
-    BrowserTestUtils.addTab(popup.gBrowser, TEST_URLS[0]);
+    popup.gBrowser.addTab(TEST_URLS[0]);
     is(popup.gBrowser.browsers.length, 2,
        "Did not restore to the popup window (2)");
 
     await BrowserTestUtils.closeWindow(popup);
 
     newWin = await promiseNewWindowLoaded();
     isnot(newWin.gBrowser.browsers.length, 2,
           "Did not restore the popup window");
--- a/browser/components/sessionstore/test/browser_625016.js
+++ b/browser/components/sessionstore/test/browser_625016.js
@@ -20,17 +20,17 @@ add_task(async function setup() {
   forgetClosedWindows();
   is(ss.getClosedWindowCount(), 0, "starting with no closed windows");
 });
 
 add_task(async function new_window() {
   let newWin;
   try {
     newWin = await promiseNewWindowLoaded();
-    let tab = BrowserTestUtils.addTab(newWin.gBrowser, "http://example.com/browser_625016.js?" + Math.random());
+    let tab = newWin.gBrowser.addTab("http://example.com/browser_625016.js?" + Math.random());
     await promiseBrowserLoaded(tab.linkedBrowser);
 
     // Double check that we have no closed windows
     is(ss.getClosedWindowCount(), 0, "no closed windows on first save");
 
     await BrowserTestUtils.closeWindow(newWin);
     newWin = null;
 
--- a/browser/components/sessionstore/test/browser_819510_perwindowpb.js
+++ b/browser/components/sessionstore/test/browser_819510_perwindowpb.js
@@ -108,12 +108,12 @@ add_task(async function test_3() {
     "Closed windows are not private");
 
   // Cleanup.
   await promiseAllButPrimaryWindowClosed();
   forgetClosedWindows();
 });
 
 async function promiseTabLoad(win, url) {
-  let tab = BrowserTestUtils.addTab(win.gBrowser, url);
+  let tab = win.gBrowser.addTab(url);
   await promiseBrowserLoaded(tab.linkedBrowser);
   await TabStateFlusher.flush(tab.linkedBrowser);
 }
--- a/browser/components/sessionstore/test/browser_broadcast.js
+++ b/browser/components/sessionstore/test/browser_broadcast.js
@@ -111,17 +111,17 @@ add_task(async function flush_on_tabclos
 
 function promiseNewWindow() {
   return new Promise(resolve => {
     whenNewWindowLoaded({private: false}, resolve);
   });
 }
 
 async function createTabWithStorageData(urls, win = window) {
-  let tab = BrowserTestUtils.addTab(win.gBrowser);
+  let tab = win.gBrowser.addTab();
   let browser = tab.linkedBrowser;
 
   for (let url of urls) {
     browser.loadURI(url);
     await promiseBrowserLoaded(browser);
     await modifySessionStorage(browser, {test: INITIAL_VALUE});
   }
 
--- a/browser/components/sessionstore/test/browser_cleaner.js
+++ b/browser/components/sessionstore/test/browser_cleaner.js
@@ -45,17 +45,17 @@ add_task(async function init() {
 add_task(async function test_open_and_close() {
   let newTab1 = BrowserTestUtils.addTab(gBrowser, URL_TAB1);
   await promiseBrowserLoaded(newTab1.linkedBrowser);
 
   let newTab2 = BrowserTestUtils.addTab(gBrowser, URL_TAB2);
   await promiseBrowserLoaded(newTab2.linkedBrowser);
 
   let newWin = await promiseNewWindowLoaded();
-  let tab = BrowserTestUtils.addTab(newWin.gBrowser, URL_NEWWIN);
+  let tab = newWin.gBrowser.addTab(URL_NEWWIN);
 
   await promiseBrowserLoaded(tab.linkedBrowser);
 
   await TabStateFlusher.flushWindow(window);
   await TabStateFlusher.flushWindow(newWin);
 
   info("1. Making sure that before closing, we don't have closedAt");
   // For the moment, no "closedAt"
--- a/browser/components/sessionstore/test/browser_crashedTabs.js
+++ b/browser/components/sessionstore/test/browser_crashedTabs.js
@@ -295,17 +295,17 @@ add_task(async function test_revive_all_
 
   browser.loadURI(PAGE_1);
   await promiseBrowserLoaded(browser);
 
   // In order to see a second about:tabcrashed page, we'll need
   // a second window, since only selected tabs will show
   // about:tabcrashed.
   let win2 = await BrowserTestUtils.openNewBrowserWindow();
-  let newTab2 = BrowserTestUtils.addTab(win2.gBrowser, PAGE_1, { sameProcessAsFrameLoader: browser.frameLoader });
+  let newTab2 = win2.gBrowser.addTab(PAGE_1, { sameProcessAsFrameLoader: browser.frameLoader });
   win2.gBrowser.selectedTab = newTab2;
   let browser2 = newTab2.linkedBrowser;
   ok(browser2.isRemoteBrowser, "Should be a remote browser");
   await promiseBrowserLoaded(browser2);
 
   browser.loadURI(PAGE_1);
   await promiseBrowserLoaded(browser);
 
@@ -402,17 +402,17 @@ add_task(async function test_hide_restor
   gBrowser.selectedTab = newTab;
 
   browser.loadURI(PAGE_2);
   await promiseBrowserLoaded(browser);
 
   // Load up a second window so we can get another tab to show
   // about:tabcrashed
   let win2 = await BrowserTestUtils.openNewBrowserWindow();
-  let newTab3 = BrowserTestUtils.addTab(win2.gBrowser, PAGE_2, { sameProcessAsFrameLoader: browser.frameLoader });
+  let newTab3 = win2.gBrowser.addTab(PAGE_2, { sameProcessAsFrameLoader: browser.frameLoader });
   win2.gBrowser.selectedTab = newTab3;
   let otherWinBrowser = newTab3.linkedBrowser;
   await promiseBrowserLoaded(otherWinBrowser);
   // We'll need to make sure the second tab's browser has finished
   // sending its AboutTabCrashedReady event before we know for
   // sure whether or not we're showing the right Restore buttons.
   let otherBrowserReady = promiseTabCrashedReady(otherWinBrowser);
 
--- a/browser/components/sessionstore/test/browser_dying_cache.js
+++ b/browser/components/sessionstore/test/browser_dying_cache.js
@@ -11,17 +11,17 @@ add_task(async function test() {
   let win = await promiseNewWindowLoaded();
 
   // Load some URL in the current tab.
   let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
   win.gBrowser.selectedBrowser.loadURI("about:robots", { flags });
   await promiseBrowserLoaded(win.gBrowser.selectedBrowser);
 
   // Open a second tab and close the first one.
-  let tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
+  let tab = win.gBrowser.addTab("about:mozilla");
   await promiseBrowserLoaded(tab.linkedBrowser);
   await TabStateFlusher.flush(tab.linkedBrowser);
   await promiseRemoveTabAndSessionState(win.gBrowser.tabs[0]);
 
   // Make sure our window is still tracked by sessionstore
   // and the window state is as expected.
   ok("__SSi" in win, "window is being tracked by sessionstore");
   ss.setWindowValue(win, "foo", "bar");
--- a/browser/components/sessionstore/test/browser_privatetabs.js
+++ b/browser/components/sessionstore/test/browser_privatetabs.js
@@ -67,31 +67,31 @@ add_task(async function() {
   forgetClosedWindows();
 
   // Create a new window to attach our frame script to.
   let win = await promiseNewWindowLoaded();
   let mm = win.getGroupMessageManager("browsers");
   mm.loadFrameScript(FRAME_SCRIPT, true);
 
   // Create a new tab in the new window that will load the frame script.
-  let tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
+  let tab = win.gBrowser.addTab("about:mozilla");
   let browser = tab.linkedBrowser;
   await promiseBrowserLoaded(browser);
   await TabStateFlusher.flush(browser);
 
   // Check that we consider the tab as private.
   let state = JSON.parse(ss.getTabState(tab));
   ok(state.isPrivate, "tab considered private");
 
   // Ensure we don't allow restoring closed private tabs in non-private windows.
   win.gBrowser.removeTab(tab);
   is(ss.getClosedTabCount(win), 0, "no tabs to restore");
 
   // Create a new tab in the new window that will load the frame script.
-  tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
+  tab = win.gBrowser.addTab("about:mozilla");
   browser = tab.linkedBrowser;
   await promiseBrowserLoaded(browser);
   await TabStateFlusher.flush(browser);
 
   // Check that we consider the tab as private.
   state = JSON.parse(ss.getTabState(tab));
   ok(state.isPrivate, "tab considered private");
 
@@ -104,17 +104,17 @@ add_task(async function() {
 add_task(async function() {
   // Clear the list of closed windows.
   forgetClosedWindows();
 
   // Create a new window to attach our frame script to.
   let win = await promiseNewWindowLoaded({private: true});
 
   // Create a new tab in the new window that will load the frame script.
-  let tab = BrowserTestUtils.addTab(win.gBrowser, "about:mozilla");
+  let tab = win.gBrowser.addTab("about:mozilla");
   let browser = tab.linkedBrowser;
   await promiseBrowserLoaded(browser);
   await TabStateFlusher.flush(browser);
 
   // Check that we consider the tab as private.
   let state = JSON.parse(ss.getTabState(tab));
   ok(state.isPrivate, "tab considered private");
 
--- a/browser/components/sessionstore/test/browser_scrollPositions.js
+++ b/browser/components/sessionstore/test/browser_scrollPositions.js
@@ -111,17 +111,17 @@ add_task(async function test_scroll_nest
  * a restored window (bug 1228518).
  * Also test that scroll positions for previous session history entries
  * are preserved as well (bug 1265818).
  */
 add_task(async function test_scroll_background_tabs() {
   pushPrefs(["browser.sessionstore.restore_on_demand", true]);
 
   let newWin = await BrowserTestUtils.openNewBrowserWindow();
-  let tab = BrowserTestUtils.addTab(newWin.gBrowser, URL);
+  let tab = newWin.gBrowser.addTab(URL);
   let browser = tab.linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
 
   // Scroll down a little.
   await sendMessage(browser, "ss-test:setScrollPosition", {x: SCROLL_X, y: SCROLL_Y});
   await checkScroll(tab, {scroll: SCROLL_STR}, "scroll on first page is fine");
 
   // Navigate to a different page and scroll there as well.
--- a/browser/components/sessionstore/test/browser_scrollPositionsReaderMode.js
+++ b/browser/components/sessionstore/test/browser_scrollPositionsReaderMode.js
@@ -16,17 +16,17 @@ requestLongerTimeout(2);
 /**
  * Test that scroll positions of about reader page after restoring background
  * tabs in a restored window (bug 1153393).
  */
 add_task(async function test_scroll_background_about_reader_tabs() {
   pushPrefs(["browser.sessionstore.restore_on_demand", true]);
 
   let newWin = await BrowserTestUtils.openNewBrowserWindow();
-  let tab = BrowserTestUtils.addTab(newWin.gBrowser, READER_MODE_URL);
+  let tab = newWin.gBrowser.addTab(READER_MODE_URL);
   let browser = tab.linkedBrowser;
   await Promise.all([
     BrowserTestUtils.browserLoaded(browser),
     BrowserTestUtils.waitForContentEvent(browser, "AboutReaderContentReady")
   ]);
 
   // Scroll down a little.
   await sendMessage(browser, "ss-test:setScrollPosition", {x: 0, y: SCROLL_READER_MODE_Y});
--- a/browser/components/sessionstore/test/browser_switch_remoteness.js
+++ b/browser/components/sessionstore/test/browser_switch_remoteness.js
@@ -11,17 +11,17 @@ function countHistoryEntries(browser, ex
   });
 }
 
 add_task(async function() {
   // Open a new window.
   let win = await promiseNewWindowLoaded();
 
   // Add a new tab.
-  let tab = BrowserTestUtils.addTab(win.gBrowser, "about:blank");
+  let tab = win.gBrowser.addTab("about:blank");
   let browser = tab.linkedBrowser;
   await promiseBrowserLoaded(browser);
   ok(browser.isRemoteBrowser, "browser is remote");
 
   // Get the maximum number of preceding entries to save.
   const MAX_BACK = Services.prefs.getIntPref("browser.sessionstore.max_serialize_back");
   ok(MAX_BACK > -1, "check that the default has a value that caps data");
 
--- a/browser/components/sessionstore/test/browser_undoCloseById.js
+++ b/browser/components/sessionstore/test/browser_undoCloseById.js
@@ -3,17 +3,17 @@
 
 /**
  * This test is for the undoCloseById function.
  */
 
 ChromeUtils.import("resource:///modules/sessionstore/SessionStore.jsm");
 
 async function openAndCloseTab(window, url) {
-  let tab = BrowserTestUtils.addTab(window.gBrowser, url);
+  let tab = window.gBrowser.addTab(url);
   await promiseBrowserLoaded(tab.linkedBrowser, true, url);
   await TabStateFlusher.flush(tab.linkedBrowser);
   await promiseRemoveTabAndSessionState(tab);
 }
 
 async function openWindow(url) {
   let win = await promiseNewWindowLoaded();
   let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
--- a/browser/components/sessionstore/test/browser_windowStateContainer.js
+++ b/browser/components/sessionstore/test/browser_windowStateContainer.js
@@ -8,19 +8,17 @@ add_task(async function setup() {
   });
 });
 
 add_task(async function() {
   let win = await BrowserTestUtils.openNewBrowserWindow();
 
   // Create 4 tabs with different userContextId.
   for (let userContextId = 1; userContextId < 5; userContextId++) {
-    let tab = BrowserTestUtils.addTab(win.gBrowser, "http://example.com/", {
-      userContextId,
-    });
+    let tab = win.gBrowser.addTab("http://example.com/", {userContextId});
     await promiseBrowserLoaded(tab.linkedBrowser);
     await TabStateFlusher.flush(tab.linkedBrowser);
   }
 
   // Move the default tab of window to the end.
   // We want the 1st tab to have non-default userContextId, so later when we
   // restore into win2 we can test restore into an existing tab with different
   // userContextId.
@@ -33,19 +31,17 @@ add_task(async function() {
                  "1st Window: tabs[" + i + "].userContextId should exist.");
   }
 
   let win2 = await BrowserTestUtils.openNewBrowserWindow();
 
   // Create tabs with different userContextId, but this time we create them with
   // fewer tabs and with different order with win.
   for (let userContextId = 3; userContextId > 0; userContextId--) {
-    let tab = BrowserTestUtils.addTab(win2.gBrowser, "http://example.com/", {
-      userContextId,
-    });
+    let tab = win2.gBrowser.addTab("http://example.com/", {userContextId});
     await promiseBrowserLoaded(tab.linkedBrowser);
     await TabStateFlusher.flush(tab.linkedBrowser);
   }
 
   await setWindowState(win2, winState, true);
 
   for (let i = 0; i < 4; i++) {
     let browser = win2.gBrowser.tabs[i].linkedBrowser;
@@ -75,37 +71,33 @@ add_task(async function() {
   await BrowserTestUtils.closeWindow(win);
   await BrowserTestUtils.closeWindow(win2);
 });
 
 add_task(async function() {
   let win = await BrowserTestUtils.openNewBrowserWindow();
   await TabStateFlusher.flush(win.gBrowser.selectedBrowser);
 
-  let tab = BrowserTestUtils.addTab(win.gBrowser, "http://example.com/", {
-    userContextId: 1,
-  });
+  let tab = win.gBrowser.addTab("http://example.com/", { userContextId: 1 });
   await promiseBrowserLoaded(tab.linkedBrowser);
   await TabStateFlusher.flush(tab.linkedBrowser);
 
   // win should have 1 default tab, and 1 container tab.
   Assert.equal(win.gBrowser.tabs.length, 2, "win should have 2 tabs");
 
   let winState = JSON.parse(ss.getWindowState(win));
 
   for (let i = 0; i < 2; i++) {
     Assert.equal(winState.windows[0].tabs[i].userContextId, i,
                  "1st Window: tabs[" + i + "].userContextId should be " + i);
   }
 
   let win2 = await BrowserTestUtils.openNewBrowserWindow();
 
-  let tab2 = BrowserTestUtils.addTab(win2.gBrowser, "http://example.com/", {
-    userContextId: 1,
-  });
+  let tab2 = win2.gBrowser.addTab("http://example.com/", { userContextId: 1 });
   await promiseBrowserLoaded(tab2.linkedBrowser);
   await TabStateFlusher.flush(tab2.linkedBrowser);
 
   // Move the first normal tab to end, so the first tab of win2 will be a
   // container tab.
   win2.gBrowser.moveTabTo(win2.gBrowser.tabs[0], win2.gBrowser.tabs.length - 1);
   await TabStateFlusher.flush(win2.gBrowser.tabs[0].linkedBrowser);
 
--- a/devtools/client/commandline/test/helpers.js
+++ b/devtools/client/commandline/test/helpers.js
@@ -66,17 +66,17 @@ var { helpers, assert } = (function () {
   helpers.addTab = function (url, callback, options) {
     waitForExplicitFinish();
 
     options = options || {};
     options.chromeWindow = options.chromeWindow || window;
     options.isFirefox = true;
 
     var tabbrowser = options.chromeWindow.gBrowser;
-    options.tab = BrowserTestUtils.addTab(tabbrowser);
+    options.tab = tabbrowser.addTab();
     tabbrowser.selectedTab = options.tab;
     options.browser = tabbrowser.getBrowserForTab(options.tab);
     options.target = TargetFactory.forTab(options.tab);
 
     var loaded = BrowserTestUtils.browserLoaded(options.browser).then(function () {
       var reply = callback.call(null, options);
 
       return Promise.resolve(reply).catch(function (error) {
@@ -112,17 +112,17 @@ var { helpers, assert } = (function () {
   helpers.openTab = function (url, options) {
     waitForExplicitFinish();
 
     options = options || {};
     options.chromeWindow = options.chromeWindow || window;
     options.isFirefox = true;
 
     var tabbrowser = options.chromeWindow.gBrowser;
-    options.tab = BrowserTestUtils.addTab(tabbrowser);
+    options.tab = tabbrowser.addTab();
     tabbrowser.selectedTab = options.tab;
     options.browser = tabbrowser.getBrowserForTab(options.tab);
     options.target = TargetFactory.forTab(options.tab);
 
     return helpers.navigate(url, options);
   };
 
 /**
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -83,17 +83,17 @@ function getChromeWindow(aWindow) {
 this.addTab = function addTab(aUrl, aWindow) {
   info("Adding tab: " + aUrl);
 
   let deferred = promise.defer();
   let targetWindow = aWindow || window;
   let targetBrowser = targetWindow.gBrowser;
 
   targetWindow.focus();
-  let tab = targetBrowser.selectedTab = BrowserTestUtils.addTab(targetBrowser, aUrl);
+  let tab = targetBrowser.selectedTab = targetBrowser.addTab(aUrl);
   let linkedBrowser = tab.linkedBrowser;
 
   info("Loading frame script with url " + FRAME_SCRIPT_URL + ".");
   linkedBrowser.messageManager.loadFrameScript(FRAME_SCRIPT_URL, false);
 
   BrowserTestUtils.browserLoaded(linkedBrowser)
     .then(function () {
       info("Tab added and finished loading: " + aUrl);
--- a/devtools/client/framework/devtools-browser.js
+++ b/devtools/client/framework/devtools-browser.js
@@ -280,25 +280,25 @@ var gDevToolsBrowser = exports.gDevTools
   },
 
   /**
    * Open a tab on "about:debugging", optionally pre-select a given tab.
    */
    // Used by browser-sets.inc, command
   openAboutDebugging(gBrowser, hash) {
     const url = "about:debugging" + (hash ? "#" + hash : "");
-    gBrowser.selectedTab = gBrowser.addTrustedTab(url);
+    gBrowser.selectedTab = gBrowser.addTab(url);
   },
 
   /**
    * Open a tab to allow connects to a remote browser
    */
    // Used by browser-sets.inc, command
   openConnectScreen(gBrowser) {
-    gBrowser.selectedTab = gBrowser.addTrustedTab("chrome://devtools/content/framework/connect/connect.xhtml");
+    gBrowser.selectedTab = gBrowser.addTab("chrome://devtools/content/framework/connect/connect.xhtml");
   },
 
   /**
    * Open WebIDE
    */
    // Used by browser-sets.inc, command
    //         itself, webide widget
   openWebIDE() {
--- a/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js
+++ b/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js
@@ -28,25 +28,18 @@ function openRequestInTab(url, requestPo
 
   if (rawData && rawData.text) {
     const stringStream = getInputStreamFromString(rawData.text);
     postData = Cc["@mozilla.org/network/mime-input-stream;1"]
       .createInstance(Ci.nsIMIMEInputStream);
     postData.addHeader("Content-Type", "application/x-www-form-urlencoded");
     postData.setData(stringStream);
   }
-  const userContextId = win.gBrowser.contentPrincipal.userContextId;
-  win.gBrowser.selectedTab = win.gBrowser.addWebTab(url, {
-    // TODO this should be using the original request principal
-    triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({
-      userContextId,
-    }),
-    userContextId,
-    postData,
-  });
+
+  win.gBrowser.selectedTab = win.gBrowser.addTab(url, { postData });
 }
 
 function getInputStreamFromString(data) {
   const stringStream = Cc["@mozilla.org/io/string-input-stream;1"]
     .createInstance(Ci.nsIStringInputStream);
   stringStream.data = data;
   return stringStream;
 }
--- a/devtools/client/performance-new/browser.js
+++ b/devtools/client/performance-new/browser.js
@@ -23,21 +23,17 @@ function receiveProfile(profile) {
   // of hosts.
   const win = Services.wm.getMostRecentWindow("navigator:browser");
   if (!win) {
     throw new Error("No browser window");
   }
   const browser = win.gBrowser;
   Services.focus.activeWindow = win;
 
-  const tab = browser.addWebTab("https://perf-html.io/from-addon", {
-    triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({
-      userContextId: browser.contentPrincipal.userContextId,
-    })
-  });
+  const tab = browser.addTab("https://perf-html.io/from-addon");
   browser.selectedTab = tab;
   const mm = tab.linkedBrowser.messageManager;
   mm.loadFrameScript(
     "chrome://devtools/content/performance-new/frame-script.js",
     false
   );
   mm.sendAsyncMessage("devtools:perf-html-transfer-profile", profile);
 }
--- a/devtools/client/responsive.html/browser/swap.js
+++ b/devtools/client/responsive.html/browser/swap.js
@@ -2,17 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { Ci } = require("chrome");
 const { E10SUtils } = require("resource://gre/modules/E10SUtils.jsm");
 const { tunnelToInnerBrowser } = require("./tunnel");
-const Services = require("Services");
 
 function debug(msg) {
   // console.log(`RDM swap: ${msg}`);
 }
 
 /**
  * Swap page content from an existing tab into a new browser within a container
  * page.  Page state is preserved by using `swapFrameLoaders`, just like when
@@ -54,20 +53,17 @@ function swapToInnerBrowser({ tab, conta
 
   // A version of `gBrowser.addTab` that absorbs the `TabOpen` event.
   // The swap process uses a temporary tab, and there's no real need for others to hear
   // about it.  This hides the temporary tab from things like WebExtensions.
   const addTabSilently = (uri, options) => {
     browserWindow.addEventListener("TabOpen", event => {
       event.stopImmediatePropagation();
     }, { capture: true, once: true });
-    options.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({
-      userContextId: options.userContextId,
-    });
-    return gBrowser.addWebTab(uri, options);
+    return gBrowser.addTab(uri, options);
   };
 
   // A version of `gBrowser.swapBrowsersAndCloseOther` that absorbs the `TabClose` event.
   // The swap process uses a temporary tab, and there's no real need for others to hear
   // about it.  This hides the temporary tab from things like WebExtensions.
   const swapBrowsersAndCloseOtherSilently = (ourTab, otherTab) => {
     browserWindow.addEventListener("TabClose", event => {
       event.stopImmediatePropagation();
--- a/devtools/client/styleeditor/test/head.js
+++ b/devtools/client/styleeditor/test/head.js
@@ -23,17 +23,17 @@ const TEST_HOST = "mochi.test:8888";
  */
 var addTab = function(url, win) {
   info("Adding a new tab with URL: '" + url + "'");
 
   return new Promise(resolve => {
     const targetWindow = win || window;
     const targetBrowser = targetWindow.gBrowser;
 
-    const tab = targetBrowser.selectedTab = BrowserTestUtils.addTab(targetBrowser, url);
+    const tab = targetBrowser.selectedTab = targetBrowser.addTab(url);
     BrowserTestUtils.browserLoaded(targetBrowser.selectedBrowser)
       .then(function() {
         info("URL '" + url + "' loading complete");
         resolve(tab);
       });
   });
 };
 
--- a/devtools/client/webconsole/test/mochitest/browser_console_webconsole_private_browsing.js
+++ b/devtools/client/webconsole/test/mochitest/browser_console_webconsole_private_browsing.js
@@ -26,17 +26,17 @@ const PRIVATE_TEST_URI = `data:text/html
   </script>`;
 
 add_task(async function() {
   await addTab(NON_PRIVATE_TEST_URI);
 
   const privateWindow = await openNewBrowserWindow({ private: true });
   ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "window is private");
   const privateBrowser = privateWindow.gBrowser;
-  privateBrowser.selectedTab = BrowserTestUtils.addTab(privateBrowser, PRIVATE_TEST_URI);
+  privateBrowser.selectedTab = privateBrowser.addTab(PRIVATE_TEST_URI);
   const privateTab = privateBrowser.selectedTab;
 
   info("private tab opened");
   ok(PrivateBrowsingUtils.isBrowserPrivate(privateBrowser.selectedBrowser),
     "tab window is private");
 
   let hud = await openConsole(privateTab);
   ok(hud, "web console opened");
--- a/devtools/startup/devtools-startup.js
+++ b/devtools/startup/devtools-startup.js
@@ -686,17 +686,17 @@ DevToolsStartup.prototype = {
       params.push("keyid=" + keyId);
     }
 
     if (params.length > 0) {
       url += "?" + params.join("&");
     }
 
     // Set relatedToCurrent: true to open the tab next to the current one.
-    gBrowser.selectedTab = gBrowser.addTrustedTab(url, {relatedToCurrent: true});
+    gBrowser.selectedTab = gBrowser.addTab(url, {relatedToCurrent: true});
   },
 
   handleConsoleFlag: function(cmdLine) {
     const window = Services.wm.getMostRecentWindow("devtools:webconsole");
     if (!window) {
       const require = this.initDevTools("CommandLine");
       const { HUDService } = require("devtools/client/webconsole/hudservice");
       HUDService.toggleBrowserConsole().catch(console.error);
--- a/devtools/startup/tests/browser/browser_shim_disable_devtools.js
+++ b/devtools/startup/tests/browser/browser_shim_disable_devtools.js
@@ -29,18 +29,17 @@ add_task(async function() {
     CustomizableUI.removeWidgetFromArea("developer-button");
   }
 
   info("Open a new window, all window-specific hooks for DevTools will be disabled.");
   const win = OpenBrowserWindow({private: false});
   await waitForDelayedStartupFinished(win);
 
   info("Open a new tab on the new window to ensure the focus is on the new window");
-  const tab = BrowserTestUtils.addTab(win.gBrowser,
-    "data:text/html;charset=utf-8,<title>foo</title>");
+  const tab = win.gBrowser.addTab("data:text/html;charset=utf-8,<title>foo</title>");
   await BrowserTestUtils.browserLoaded(win.gBrowser.getBrowserForTab(tab));
 
   info("Synthesize a DevTools shortcut, the toolbox should not open on this new window.");
   synthesizeToggleToolboxKey(win);
 
   // There is no event to wait for here as this shortcut should have no effect.
   /* eslint-disable mozilla/no-arbitrary-setTimeout */
   await new Promise(r => setTimeout(r, 1000));
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -945,17 +945,16 @@ nsDocShell::LoadURI(nsIURI* aURI,
     else {
       triggeringPrincipal = nsContentUtils::GetSystemPrincipal();
     }
   }
 
   uint32_t flags = 0;
 
   if (inheritPrincipal) {
-    MOZ_ASSERT(!nsContentUtils::IsSystemPrincipal(principalToInherit), "Should not inherit SystemPrincipal");
     flags |= INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL;
   }
 
   if (!sendReferrer) {
     flags |= INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER;
   }
 
   if (aLoadFlags & LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP) {
--- a/docshell/test/browser/head.js
+++ b/docshell/test/browser/head.js
@@ -43,18 +43,17 @@ function timelineTestOpenUrl(url) {
 
   let tabSwitchPromise = new Promise((resolve, reject) => {
     window.gBrowser.addEventListener("TabSwitchDone", function() {
       resolve();
     }, {once: true});
   });
 
   let loadPromise = new Promise(function(resolve, reject) {
-    let browser = window.gBrowser;
-    let tab = browser.selectedTab = BrowserTestUtils.addTab(browser, url);
+    let tab = window.gBrowser.selectedTab = window.gBrowser.addTab(url);
     let linkedBrowser = tab.linkedBrowser;
 
     BrowserTestUtils.browserLoaded(linkedBrowser).then(() => resolve(tab));
   });
 
   return Promise.all([tabSwitchPromise, loadPromise]).then(([_, tab]) => tab);
 }
 
--- a/dom/base/test/browser_blocking_image.js
+++ b/dom/base/test/browser_blocking_image.js
@@ -1,15 +1,15 @@
 const TEST_URI = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com") + "file_blocking_image.html";
 
 /**
  * Loading an image from https:// should work.
  */
 add_task(async function load_image_from_https_test() {
-  let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
+  let tab = gBrowser.addTab(TEST_URI);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   gBrowser.selectedTab = tab;
 
   await ContentTask.spawn(tab.linkedBrowser, { }, async function() {
     function imgListener(img) {
       return new Promise((resolve, reject) => {
         img.addEventListener("load", () => resolve());
@@ -33,17 +33,17 @@ add_task(async function load_image_from_
 
   gBrowser.removeTab(tab);
 });
 
 /**
  * Loading an image from http:// should be rejected.
  */
 add_task(async function load_image_from_http_test() {
-  let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
+  let tab = gBrowser.addTab(TEST_URI);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   gBrowser.selectedTab = tab;
 
   await ContentTask.spawn(tab.linkedBrowser, { }, async function () {
     function imgListener(img) {
       return new Promise((resolve, reject) => {
         img.addEventListener("load", () => reject());
@@ -69,17 +69,17 @@ add_task(async function load_image_from_
   gBrowser.removeTab(tab);
 });
 
 /**
  * Loading an image from http:// immediately after loading from https://
  * The load from https:// should be replaced.
  */
 add_task(async function load_https_and_http_test() {
-  let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
+  let tab = gBrowser.addTab(TEST_URI);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   // Clear image cache, otherwise in non-e10s mode the image might be cached by
   // previous test, and make the image from https is loaded immediately.
   let imgTools = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools);
   let imageCache = imgTools.getImgCacheForDocument(window.document);
   imageCache.clearCache(false); // false=content
 
@@ -116,17 +116,17 @@ add_task(async function load_https_and_h
 /**
  * Loading an image from https.
  * Then after we have size information of the image, we immediately change the
  * location to a http:// site (hence should be blocked by CSP). This will make
  * the 2nd request as a PENDING_REQUEST, also blocking 2nd load shouldn't change
  * the imageBlockingStatus value.
  */
 add_task(async function block_pending_request_test() {
-  let tab = BrowserTestUtils.addTab(gBrowser, TEST_URI);
+  let tab = gBrowser.addTab(TEST_URI);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   gBrowser.selectedTab = tab;
 
   await ContentTask.spawn(tab.linkedBrowser, { }, async function () {
     let wrapper = {
       _resolve: null,
       _sizeAvail: false,
--- a/dom/broadcastchannel/tests/browser_private_browsing.js
+++ b/dom/broadcastchannel/tests/browser_private_browsing.js
@@ -15,21 +15,21 @@ add_task(async function() {
   var win2 = OpenBrowserWindow({private: false});
   var win2Promise = new win2.Promise(resolve => {
     win2.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
   await win2Promise;
 
-  var tab1 = BrowserTestUtils.addTab(win1.gBrowser, URL);
+  var tab1 = win1.gBrowser.addTab(URL);
   await BrowserTestUtils.browserLoaded(win1.gBrowser.getBrowserForTab(tab1));
   var browser1 = gBrowser.getBrowserForTab(tab1);
 
-  var tab2 = BrowserTestUtils.addTab(win2.gBrowser, URL);
+  var tab2 = win2.gBrowser.addTab(URL);
   await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
   var browser2 = gBrowser.getBrowserForTab(tab2);
 
   var p1 = ContentTask.spawn(browser1, null, function(opts) {
     return new content.window.Promise(resolve => {
       content.window.bc = new content.window.BroadcastChannel('foobar');
       content.window.bc.onmessage = function(e) { resolve(e.data); }
     });
--- a/dom/cache/test/mochitest/browser_cache_pb_window.js
+++ b/dom/cache/test/mochitest/browser_cache_pb_window.js
@@ -100,17 +100,17 @@ function test() {
   let privateWin, privateTab;
   waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({'set': [['dom.caches.enabled', true],
                                      ['dom.caches.testing.enabled', true]]}
   ).then(() => {
     return BrowserTestUtils.openNewBrowserWindow({private: true});
   }).then(pw => {
     privateWin = pw;
-    privateTab = BrowserTestUtils.addTab(pw.gBrowser, "http://example.com/");
+    privateTab = pw.gBrowser.addTab("http://example.com/");
     return BrowserTestUtils.browserLoaded(privateTab.linkedBrowser);
   }).then(tab => {
     return Promise.all([
       testMatch(privateTab.linkedBrowser),
       testHas(privateTab.linkedBrowser),
       testOpen(privateTab.linkedBrowser),
       testDelete(privateTab.linkedBrowser),
       testKeys(privateTab.linkedBrowser),
--- a/dom/html/test/browser_bug1108547.js
+++ b/dom/html/test/browser_bug1108547.js
@@ -38,17 +38,17 @@ function runPass(getterFile, finishedCal
 
     // Now, open a private window.
     privateWin = OpenBrowserWindow({private: true});
       whenDelayedStartupFinished(privateWin, afterPrivateWindowOpened);
   }
 
   function afterPrivateWindowOpened() {
     // In the private window, open the getter file, and wait for a new tab to be opened.
-    privateWin.gBrowser.selectedTab = BrowserTestUtils.addTab(privateWin.gBrowser, rootDir + getterFile);
+    privateWin.gBrowser.selectedTab = privateWin.gBrowser.addTab(rootDir + getterFile);
     testBrowser = privateWin.gBrowser.selectedBrowser;
     privateWin.gBrowser.tabContainer.addEventListener("TabOpen", onNewTabOpened, true);
   }
 
   function fetchResult() {
     return ContentTask.spawn(testBrowser, null, function() {
       return content.document.getElementById("result").textContent;
     });
@@ -72,17 +72,17 @@ function runPass(getterFile, finishedCal
 
     // Open a new private window, this time to set a cookie inside it.
     privateWin = OpenBrowserWindow({private: true});
       whenDelayedStartupFinished(privateWin, afterPrivateWindowOpened2);
   }
 
   function afterPrivateWindowOpened2() {
     // In the private window, open the setter file, and wait for it to load.
-    privateWin.gBrowser.selectedTab = BrowserTestUtils.addTab(privateWin.gBrowser, rootDir + "file_bug1108547-1.html");
+    privateWin.gBrowser.selectedTab = privateWin.gBrowser.addTab(rootDir + "file_bug1108547-1.html");
     BrowserTestUtils.browserLoaded(privateWin.gBrowser.selectedBrowser).then(afterOpenCookieSetter2);
   }
 
   function afterOpenCookieSetter2() {
     // We're done with the private window now, close it.
     privateWin.close();
 
     // Now try to read the cookie in a normal window, and wait for a new tab to be opened.
--- a/dom/indexedDB/test/browser_permissionsPromptDeny.js
+++ b/dom/indexedDB/test/browser_permissionsPromptDeny.js
@@ -44,17 +44,17 @@ add_task(async function test2() {
   registerPopupEventHandler("popupshown", function() {
     ok(false, "prompt shown");
   }, win);
   registerPopupEventHandler("popuphidden", function() {
     ok(false, "prompt hidden");
   }, win);
 
   info("creating private tab");
-  win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
+  win.gBrowser.selectedTab = win.gBrowser.addTab();
 
   info("loading test page: " + testPageURL);
   win.gBrowser.selectedBrowser.loadURI(testPageURL);
   await waitForMessage("InvalidStateError", win.gBrowser);
 
   is(getPermission(testPageURL, "indexedDB"),
      Ci.nsIPermissionManager.DENY_ACTION,
      "Correct permission set");
--- a/dom/indexedDB/test/browser_perwindow_privateBrowsing.js
+++ b/dom/indexedDB/test/browser_perwindow_privateBrowsing.js
@@ -21,15 +21,15 @@ add_task(async function test1() {
   gBrowser.removeCurrentTab();
 });
 
 add_task(async function test2() {
   info("creating private window");
   let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
 
   info("creating tab");
-  win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
+  win.gBrowser.selectedTab = win.gBrowser.addTab();
   win.gBrowser.selectedBrowser.loadURI(testPageURL);
   await waitForMessage("InvalidStateError", win.gBrowser);
   win.gBrowser.removeCurrentTab();
   await BrowserTestUtils.closeWindow(win);
   win = null;
 });
--- a/dom/quota/test/browser_permissionsPromptUnknown.js
+++ b/dom/quota/test/browser_permissionsPromptUnknown.js
@@ -17,17 +17,17 @@ add_task(async function testPermissionUn
   registerPopupEventHandler("popupshown", function () {
     ok(false, "Shouldn't show a popup this time");
   }, win);
   registerPopupEventHandler("popuphidden", function () {
     ok(false, "Shouldn't show a popup this time");
   }, win);
 
   info("Creating private tab");
-  win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
+  win.gBrowser.selectedTab = win.gBrowser.addTab();
 
   info("Loading test page: " + testPageURL);
   win.gBrowser.selectedBrowser.loadURI(testPageURL);
   await waitForMessage(false, win.gBrowser);
 
   is(getPermission(testPageURL, "persistent-storage"),
      Ci.nsIPermissionManager.UNKNOWN_ACTION,
      "Correct permission set");
--- a/dom/tests/browser/browser_localStorage_privatestorageevent.js
+++ b/dom/tests/browser/browser_localStorage_privatestorageevent.js
@@ -10,21 +10,21 @@ add_task(async function() {
   await new pubWin.Promise(resolve => {
     pubWin.addEventListener('load', function() {
       resolve();
     }, {once: true});
   });
 
   var URL = "http://mochi.test:8888/browser/dom/tests/browser/page_privatestorageevent.html";
 
-  var privTab = BrowserTestUtils.addTab(privWin.gBrowser, URL);
+  var privTab = privWin.gBrowser.addTab(URL);
   await BrowserTestUtils.browserLoaded(privWin.gBrowser.getBrowserForTab(privTab));
   var privBrowser = gBrowser.getBrowserForTab(privTab);
 
-  var pubTab = BrowserTestUtils.addTab(pubWin.gBrowser, URL);
+  var pubTab = pubWin.gBrowser.addTab(URL);
   await BrowserTestUtils.browserLoaded(pubWin.gBrowser.getBrowserForTab(pubTab));
   var pubBrowser = gBrowser.getBrowserForTab(pubTab);
 
   // Check if pubWin can see privWin's storage events
   await ContentTask.spawn(pubBrowser, null, function(opts) {
     content.window.gotStorageEvent = false;
     content.window.addEventListener('storage', ev => {
       content.window.gotStorageEvent = true;
--- a/dom/tests/browser/helper_largeAllocation.js
+++ b/dom/tests/browser/helper_largeAllocation.js
@@ -415,18 +415,17 @@ async function largeAllocSuccessTests() 
 
     let pid2 = await getPID(aBrowser);
 
     isnot(pid1, pid2, "PIDs 1 and 2 should not match");
     is(true, await getInLAProc(aBrowser));
 
     let newWindow = await BrowserTestUtils.openNewBrowserWindow();
 
-    newWindow.gBrowser.adoptTab(gBrowser.getTabForBrowser(aBrowser), 0, null,
-                                Services.scriptSecurityManager.getSystemPrincipal());
+    newWindow.gBrowser.adoptTab(gBrowser.getTabForBrowser(aBrowser), 0);
     let newTab = newWindow.gBrowser.tabs[0];
 
     is(newTab.linkedBrowser.currentURI.spec, TEST_URI);
     is(newTab.linkedBrowser.remoteType, "webLargeAllocation");
     let pid3 = await getPID(newTab.linkedBrowser);
 
     is(pid2, pid3, "PIDs 2 and 3 should match");
     is(true, await getInLAProc(newTab.linkedBrowser));
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1182,26 +1182,23 @@ var BrowserApp = {
     let referrerURI = "referrerURI" in aParams ? aParams.referrerURI : null;
     let charset = "charset" in aParams ? aParams.charset : null;
 
     let tab = this.getTabForBrowser(aBrowser);
     if (tab) {
       if ("userRequested" in aParams) tab.userRequested = aParams.userRequested;
       tab.isSearch = ("isSearch" in aParams) ? aParams.isSearch : false;
     }
-    // Don't fall back to System here Bug 1474619
-    let triggeringPrincipal = "triggeringPrincipal" in aParams ? aParams.triggeringPrincipal : Services.scriptSecurityManager.getSystemPrincipal();
 
     try {
       aBrowser.loadURI(aURI, {
         flags,
         referrerURI,
         charset,
         postData,
-        triggeringPrincipal,
       });
     } catch(e) {
       if (tab) {
         let message = {
           type: "Content:LoadError",
           tabID: tab.id
         };
         GlobalEventDispatcher.sendRequest(message);
--- a/mobile/android/components/extensions/ext-tabs.js
+++ b/mobile/android/components/extensions/ext-tabs.js
@@ -242,33 +242,29 @@ this.tabs = class extends ExtensionAPI {
             return () => {
               windowTracker.removeListener("status", statusListener);
               windowTracker.removeListener("DOMTitleChanged", listener);
             };
           },
         }).api(),
 
         async create(createProperties) {
-          let principal = context.principal;
           let window = createProperties.windowId !== null ?
             windowTracker.getWindow(createProperties.windowId, context) :
             windowTracker.topWindow;
 
           let {BrowserApp} = window;
           let url;
 
           if (createProperties.url !== null) {
             url = context.uri.resolve(createProperties.url);
 
             if (!context.checkLoadURL(url, {dontReportErrors: true})) {
               return Promise.reject({message: `Illegal URL: ${url}`});
             }
-          } else {
-            // Falling back to system here as about:newtab requires it, however is safe.
-            principal = Services.scriptSecurityManager.getSystemPrincipal();
           }
 
           let options = {};
 
           let active = true;
           if (createProperties.active !== null) {
             active = createProperties.active;
           }
@@ -284,17 +280,16 @@ this.tabs = class extends ExtensionAPI {
             options.disallowInheritPrincipal = true;
           } else {
             options.triggeringPrincipal = context.principal;
           }
 
           options.parentId = BrowserApp.selectedTab.id;
 
           tabListener.initTabReady();
-          options.triggeringPrincipal = principal;
           let nativeTab = BrowserApp.addTab(url, options);
 
           if (createProperties.url) {
             tabListener.initializingTabs.add(nativeTab);
           }
 
           return tabManager.convert(nativeTab);
         },
--- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
+++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
@@ -191,17 +191,17 @@ var BrowserTestUtils = {
       }
 
       promises = [
         BrowserTestUtils.switchTab(tabbrowser, function() {
           if (typeof opening == "function") {
             opening();
             tab = tabbrowser.selectedTab;
           } else {
-            tabbrowser.selectedTab = tab = BrowserTestUtils.addTab(tabbrowser, opening);
+            tabbrowser.selectedTab = tab = tabbrowser.addTab(opening);
           }
         })
       ];
 
       if (aWaitForLoad) {
         promises.push(BrowserTestUtils.browserLoaded(tab.linkedBrowser));
       }
       if (aWaitForStateStop) {
--- a/testing/mochitest/api.js
+++ b/testing/mochitest/api.js
@@ -90,18 +90,17 @@ var WindowListener = {
 function loadMochitest(e) {
   let flavor = e.detail[0];
   let url = e.detail[1];
 
   let win = Services.wm.getMostRecentWindow("navigator:browser");
   win.removeEventListener("mochitest-load", loadMochitest);
 
   // for mochitest-plain, navigating to the url is all we need
-  win.loadURI(url, null, null, null, null, null, null, null,
-    Services.scriptSecurityManager.getSystemPrincipal());
+  win.loadURI(url);
   if (flavor == "mochitest") {
     return;
   }
 
   WindowListener.setupWindow(win);
   Services.wm.addListener(WindowListener);
 
   loadChromeScripts(win);
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -571,20 +571,17 @@ Tester.prototype = {
           }));
         }
         gBrowser.removeTab(lastTab);
       }
     }
 
     // Replace the last tab with a fresh one
     if (window.gBrowser) {
-      gBrowser.addTab("about:blank", {
-        skipAnimation: true,
-        triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-      });
+      gBrowser.addTab("about:blank", { skipAnimation: true });
       gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
       gBrowser.stop();
     }
 
     // Remove stale windows
     this.structuredLogger.info("checking window state");
     let windowsEnum = Services.wm.getEnumerator(null);
     while (windowsEnum.hasMoreElements()) {
--- a/testing/talos/talos/startup_test/sessionrestore/addon/bootstrap.js
+++ b/testing/talos/talos/startup_test/sessionrestore/addon/bootstrap.js
@@ -123,17 +123,17 @@ const sessionRestoreTest = {
       // the results) in a new tab _after_ the window has opened, we need to send
       // those arguments over to the new tab that we open so that the profiler scripts
       // will continue to work.
       Cu.importGlobalProperties(["URL"]);
       let url = new URL(args.queryElementAt(0, Ci.nsISupportsString).data);
       queryString = url.search;
     }
 
-    win.gBrowser.addTrustedTab("chrome://session-restore-test/content/index.html" + queryString);
+    win.gBrowser.addTab("chrome://session-restore-test/content/index.html" + queryString);
   }
 };
 
 
 function startup(data, reason) {
   sessionRestoreTest.init();
 }
 
--- a/testing/talos/talos/tests/devtools/addon/content/damp.js
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.js
@@ -152,17 +152,17 @@ Damp.prototype = {
         } else if (DEBUG_ALLOCATIONS == "verbose") {
           this.allocationTracker.logAllocationSites();
         }
       }
     };
   },
 
   async addTab(url) {
-    let tab = this._win.gBrowser.selectedTab = this._win.gBrowser.addTrustedTab(url);
+    let tab = this._win.gBrowser.selectedTab = this._win.gBrowser.addTab(url);
     let browser = tab.linkedBrowser;
     await awaitBrowserLoaded(browser);
     return tab;
   },
 
   async waitForPendingPaints(window) {
     let utils = window.windowUtils;
     window.performance.mark("pending paints.start");
--- a/testing/talos/talos/tests/tart/addon/content/tart.js
+++ b/testing/talos/talos/tests/tart/addon/content/tart.js
@@ -156,17 +156,17 @@ Tart.prototype = {
   fadeInCurrentTab() {
     this._endDetection = this.tabDetector;
     this._win.gBrowser.selectedTab.setAttribute("fadein", "true");
   },
 
 
   addSomeChromeUriTab() {
     this._endDetection = this.tabDetector;
-    this._win.gBrowser.selectedTab = this._win.gBrowser.addTrustedTab("chrome://tart/content/blank.icon.html");
+    this._win.gBrowser.selectedTab = this._win.gBrowser.addTab("chrome://tart/content/blank.icon.html");
   },
 
   triggerCustomizeEnter() {
     this._endDetection = this.customizeEnterDetector;
     this._win.gCustomizeMode.enter();
   },
 
   triggerCustomizeEnterCss() {
--- a/toolkit/components/extensions/test/browser/browser_ext_themes_tab_separators.js
+++ b/toolkit/components/extensions/test/browser/browser_ext_themes_tab_separators.js
@@ -13,17 +13,17 @@ add_task(async function test_support_tab
         },
       },
     },
   });
   await extension.startup();
 
   info("Checking background tab separator color");
 
-  let tab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  let tab = gBrowser.addTab("about:blank");
 
   Assert.equal(window.getComputedStyle(tab, "::before").borderLeftColor,
                `rgb(${hexToRGB(TAB_SEPARATOR_COLOR).join(", ")})`,
                "Left separator has right color.");
 
   Assert.equal(window.getComputedStyle(tab, "::after").borderLeftColor,
                `rgb(${hexToRGB(TAB_SEPARATOR_COLOR).join(", ")})`,
                "Right separator has right color.");
--- a/toolkit/components/normandy/lib/Heartbeat.jsm
+++ b/toolkit/components/normandy/lib/Heartbeat.jsm
@@ -341,20 +341,17 @@ var Heartbeat = class {
     }
 
     // Open the engagement tab if we have a valid engagement URL.
     if (this.options.postAnswerUrl) {
       for (const key in engagementParams) {
         this.options.postAnswerUrl.searchParams.append(key, engagementParams[key]);
       }
       // Open the engagement URL in a new tab.
-      let { gBrowser} = this.chromeWindow;
-      gBrowser.selectedTab = gBrowser.addWebTab(this.options.postAnswerUrl.toString(), {
-        triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
-      });
+      this.chromeWindow.gBrowser.selectedTab = this.chromeWindow.gBrowser.addTab(this.options.postAnswerUrl.toString());
     }
 
     this.endTimerIfPresent("surveyEndTimer");
 
     this.engagementCloseTimer = setTimeout(() => this.close(), NOTIFICATION_TIME);
   }
 
   endTimerIfPresent(timerName) {
--- a/toolkit/content/tests/browser/browser_block_autoplay_media.js
+++ b/toolkit/content/tests/browser/browser_block_autoplay_media.js
@@ -33,25 +33,25 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function block_autoplay_media() {
   info("- open new background tab1 -");
-  let tab1 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab1 = window.gBrowser.addTab("about:blank");
   tab1.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
 
   info("- should block autoplay media for non-visited tab1 -");
   await check_audio_suspended(tab1.linkedBrowser, SuspendedType.SUSPENDED_BLOCK);
 
   info("- open new background tab2 -");
-  let tab2 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab2 = window.gBrowser.addTab("about:blank");
   tab2.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
 
   info("- should block autoplay for non-visited tab2 -");
   await check_audio_suspended(tab2.linkedBrowser, SuspendedType.SUSPENDED_BLOCK);
 
   info("- select tab1 as foreground tab -");
   await BrowserTestUtils.switchTab(window.gBrowser, tab1);
@@ -85,17 +85,17 @@ add_task(async function block_autoplay_m
   // to satisfy the autoplay requirements on its own.
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.PROMPT],
     ["media.autoplay.enabled.user-gestures-needed", true],
     ["media.autoplay.ask-permission", true],
   ]});
 
   info("- open new background tab4 -");
-  let tab4 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab4 = window.gBrowser.addTab("about:blank");
   tab4.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab4.linkedBrowser);
   info("- should block autoplay for non-visited tab4 -");
   await check_audio_suspended(tab4.linkedBrowser, SuspendedType.SUSPENDED_BLOCK);
   await check_audio_paused(tab4.linkedBrowser, true);
   tab4.linkedBrowser.resumeMedia();
   info("- should not block media from tab4 -");
   await waitForTabPlayingEvent(tab4, true);
--- a/toolkit/content/tests/browser/browser_block_autoplay_media_pausedAfterPlay.js
+++ b/toolkit/content/tests/browser/browser_block_autoplay_media_pausedAfterPlay.js
@@ -32,27 +32,27 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function block_autoplay_media() {
   info("- open new background tab1, and check tab1's media suspend type -");
-  let tab1 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab1 = window.gBrowser.addTab("about:blank");
   tab1.linkedBrowser.loadURI(PAGE_SHOULD_NOT_PLAY);
   await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
   await ContentTask.spawn(tab1.linkedBrowser, SuspendedType.NONE_SUSPENDED,
                           check_audio_suspended);
 
   info("- the tab1 should not be blocked -");
   await waitForTabBlockEvent(tab1, false);
 
   info("- open new background tab2, and check tab2's media suspend type -");
-  let tab2 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab2 = window.gBrowser.addTab("about:blank");
   tab2.linkedBrowser.loadURI(PAGE_SHOULD_PLAY);
   await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
   await ContentTask.spawn(tab2.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
                           check_audio_suspended);
 
   info("- the tab2 should be blocked -");
   await waitForTabBlockEvent(tab2, true);
 
--- a/toolkit/content/tests/browser/browser_block_autoplay_playAfterTabVisible.js
+++ b/toolkit/content/tests/browser/browser_block_autoplay_playAfterTabVisible.js
@@ -53,17 +53,17 @@ add_task(async function setup_test_prefe
 
 /**
  * This test is used for testing the visible tab which was not resumed yet.
  * If the tab doesn't have any media component, it won't be resumed even it
  * has already gone to foreground until we start audio.
  */
 add_task(async function media_should_be_able_to_play_in_visible_tab() {
   info("- open new background tab, and check tab's media pause state -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await ContentTask.spawn(tab.linkedBrowser, true,
                           check_audio_pause_state);
 
   info("- select tab as foreground tab, and tab's media should still be paused -");
   await BrowserTestUtils.switchTab(window.gBrowser, tab);
   await ContentTask.spawn(tab.linkedBrowser, true,
--- a/toolkit/content/tests/browser/browser_block_multipleMedia.js
+++ b/toolkit/content/tests/browser/browser_block_multipleMedia.js
@@ -79,17 +79,17 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function block_multiple_media() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   let browser = tab.linkedBrowser;
   browser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(browser);
 
   info("- tab should be blocked -");
   await waitForTabBlockEvent(tab, true);
 
   info("- autoplay media should be blocked -");
--- a/toolkit/content/tests/browser/browser_block_notInTreeAudio.js
+++ b/toolkit/content/tests/browser/browser_block_notInTreeAudio.js
@@ -47,17 +47,17 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function block_not_in_tree_media() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("- tab should not be blocked -");
   await waitForTabBlockEvent(tab, false);
 
   info("- check audio's suspend state -");
   await ContentTask.spawn(tab.linkedBrowser, SuspendedType.NONE_SUSPENDED,
--- a/toolkit/content/tests/browser/browser_block_playMediaInMuteTab.js
+++ b/toolkit/content/tests/browser/browser_block_playMediaInMuteTab.js
@@ -58,17 +58,17 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function unblock_icon_should_disapear_after_resume_tab() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("- audio doesn't be started in beginning -");
   await ContentTask.spawn(tab.linkedBrowser, true,
                           check_audio_pause_state);
 
   info("- audio shouldn't be muted or blocked -");
--- a/toolkit/content/tests/browser/browser_block_plugIn.js
+++ b/toolkit/content/tests/browser/browser_block_plugIn.js
@@ -5,17 +5,17 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function block_plug_in() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("- tab should be blocked -");
   await waitForTabBlockEvent(tab, true);
 
   info("- switch tab -");
   await BrowserTestUtils.switchTab(window.gBrowser, tab);
--- a/toolkit/content/tests/browser/browser_block_silentAudioTrack_media.js
+++ b/toolkit/content/tests/browser/browser_block_silentAudioTrack_media.js
@@ -29,17 +29,17 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function unblock_icon_should_disapear_after_resume_tab() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("- the suspend state of tab should be suspend-block -");
   await ContentTask.spawn(tab.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
                           check_audio_suspended);
 
   info("- tab should display unblocking icon -");
@@ -59,17 +59,17 @@ add_task(async function unblock_icon_sho
   await waitForTabPlayingEvent(tab, false);
 
   info("- remove tab -");
   BrowserTestUtils.removeTab(tab);
 });
 
 add_task(async function should_not_show_sound_indicator_after_resume_tab() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("- the suspend state of tab should be suspend-block -");
   await ContentTask.spawn(tab.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
                           check_audio_suspended);
 
   info("- tab should display unblocking icon -");
--- a/toolkit/content/tests/browser/browser_block_webAudio.js
+++ b/toolkit/content/tests/browser/browser_block_webAudio.js
@@ -11,17 +11,17 @@ add_task(async function setup_test_prefe
   await SpecialPowers.pushPrefEnv({"set": [
     ["media.useAudioChannelService.testing", true],
     ["media.block-autoplay-until-in-foreground", true]
   ]});
 });
 
 add_task(async function block_web_audio() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   tab.linkedBrowser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("- tab should be blocked -");
   await waitForTabBlockEvent(tab, true);
 
   info("- switch tab -");
   await BrowserTestUtils.switchTab(window.gBrowser, tab);
--- a/toolkit/content/tests/browser/browser_resume_bkg_video_on_tab_hover.js
+++ b/toolkit/content/tests/browser/browser_resume_bkg_video_on_tab_hover.js
@@ -97,17 +97,17 @@ add_task(async function setup_test_prefe
 
 /**
  * TODO : add the following user-level tests after fixing bug1029451.
  * test1 - only affect the unselected tab
  * test2 - only affect the tab with suspended video
  */
 add_task(async function resume_and_suspend_background_video_decoding() {
   info("- open new background tab -");
-  let tab = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
+  let tab = window.gBrowser.addTab("about:blank");
   let browser = tab.linkedBrowser;
 
   info("- before loading media, we shoudn't send the tab hover msg for tab -");
   await check_should_not_send_unselected_tab_hover_msg(browser);
   browser.loadURI(PAGE);
   await BrowserTestUtils.browserLoaded(browser);
 
   info("- should suspend background video decoding -");