Bug 1111276 - Replace gBrowser.selectedTab.linkedBrowser with gBrowser.selectedBrowser. r=dao
authorabdelrhman <codo.abdo@gmail.com>
Mon, 15 Dec 2014 22:05:46 +0100
changeset 219900 1439cb361d99fa1d58b7164018177213656a0090
parent 219899 802cc1027e7691e26628f778cabc419813fe7c67
child 219901 cf9718aa24bcaf9d01561ddfda3bb29c447698c7
push id27971
push usercbook@mozilla.com
push dateTue, 16 Dec 2014 12:40:03 +0000
treeherdermozilla-central@249dbdbe09e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1111276
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1111276 - Replace gBrowser.selectedTab.linkedBrowser with gBrowser.selectedBrowser. r=dao
addon-sdk/source/test/addons/page-mod-debugger-post/main.js
addon-sdk/source/test/addons/page-mod-debugger-pre/main.js
browser/base/content/test/general/browser_aboutHome.js
browser/base/content/test/general/browser_aboutSyncProgress.js
browser/base/content/test/general/browser_bug561636.js
browser/base/content/test/general/browser_bug595507.js
browser/base/content/test/general/browser_devices_get_user_media.js
browser/base/content/test/general/browser_notification_tab_switching.js
browser/base/content/test/newtab/browser_newtab_bug991210.js
browser/base/content/test/social/browser_aboutHome_activation.js
browser/base/content/test/social/browser_social_marks.js
browser/components/customizableui/test/browser_967000_button_sync.js
browser/components/places/tests/browser/browser_markPageAsFollowedLink.js
browser/devtools/debugger/test/browser_dbg_navigation.js
browser/devtools/eyedropper/test/browser_eyedropper_basic.js
browser/devtools/eyedropper/test/browser_eyedropper_cmd.js
browser/devtools/inspector/test/head.js
browser/devtools/shared/DeveloperToolbar.jsm
browser/devtools/styleeditor/test/browser_styleeditor_reload.js
browser/devtools/styleeditor/test/browser_styleeditor_selectstylesheet.js
browser/devtools/styleinspector/test/browser_ruleview_eyedropper.js
browser/devtools/styleinspector/test/head.js
browser/modules/test/browser_UITour_detach_tab.js
browser/modules/test/browser_UITour_sync.js
dom/tests/browser/browser_autofocus_preference.js
layout/base/tests/browser_bug617076.js
toolkit/components/places/tests/browser/browser_notfound.js
toolkit/components/places/tests/browser/browser_redirect.js
toolkit/components/places/tests/browser/browser_visited_notfound.js
toolkit/components/thumbnails/test/head.js
toolkit/devtools/server/tests/browser/browser_navigateEvents.js
toolkit/devtools/tests/mochitest/test_devtools_extensions.html
toolkit/mozapps/extensions/test/browser/browser_experiments.js
toolkit/mozapps/extensions/test/browser/browser_tabsettings.js
--- a/addon-sdk/source/test/addons/page-mod-debugger-post/main.js
+++ b/addon-sdk/source/test/addons/page-mod-debugger-post/main.js
@@ -87,17 +87,17 @@ function testDebuggerStatement([aGrip, a
   mod = PageMod({
     include: TAB_URL,
     attachTo: ['existing', 'top', 'frame'],
     contentScriptFile: data.url('script.js'),
     onAttach: function(mod) {
       ok(true, 'the page-mod was attached to ' + mod.tab.url);
 
       require('sdk/timers').setTimeout(function() {
-        let debuggee = getMostRecentBrowserWindow().gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
+        let debuggee = getMostRecentBrowserWindow().gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
         debuggee.runDebuggerStatement();
         ok(true, 'called runDebuggerStatement');
       }, 500)
     }
   });
   ok(true, 'PageMod was created');
 
   return deferred.promise;
--- a/addon-sdk/source/test/addons/page-mod-debugger-pre/main.js
+++ b/addon-sdk/source/test/addons/page-mod-debugger-pre/main.js
@@ -86,17 +86,17 @@ function testDebuggerStatement([aGrip, a
   gClient.addListener("paused", (aEvent, aPacket) => {
     ok(true, 'there was a pause event');
     gClient.request({ to: aResponse.threadActor, type: "resume" }, () => {
       ok(true, "The pause handler was triggered on a debugger statement.");
       deferred.resolve();
     });
   });
 
-  let debuggee = getMostRecentBrowserWindow().gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
+  let debuggee = getMostRecentBrowserWindow().gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
   debuggee.runDebuggerStatement();
   ok(true, 'called runDebuggerStatement');
 
   return deferred.promise;
 }
 
 function getTabActorForUrl(aClient, aUrl) {
   let deferred = promise.defer();
--- a/browser/base/content/test/general/browser_aboutHome.js
+++ b/browser/base/content/test/general/browser_aboutHome.js
@@ -45,34 +45,34 @@ let gTests = [
   }
 },
 
 {
   desc: "Check default snippets are shown",
   setup: function () { },
   run: function ()
   {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element")
     is(snippetsElt.getElementsByTagName("span").length, 1,
        "A default snippet is present.");
   }
 },
 
 {
   desc: "Check default snippets are shown if snippets are invalid xml",
   setup: function (aSnippetsMap)
   {
     // This must be some incorrect xhtml code.
     aSnippetsMap.set("snippets", "<p><b></p></b>");
   },
   run: function (aSnippetsMap)
   {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
 
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element");
     is(snippetsElt.getElementsByTagName("span").length, 1,
        "A default snippet is present.");
 
     aSnippetsMap.delete("snippets");
   }
@@ -105,17 +105,17 @@ let gTests = [
     Services.search.currentEngine = engine;
     yield promise;
 
     let numSearchesBefore = 0;
     let searchEventDeferred = Promise.defer();
     let doc = gBrowser.contentDocument;
     let engineName = doc.documentElement.getAttribute("searchEngineName");
     is(engine.name, engineName, "Engine name in DOM should match engine we just added");
-    let mm = gBrowser.selectedTab.linkedBrowser.messageManager;
+    let mm = gBrowser.selectedBrowser.messageManager;
 
     mm.loadFrameScript(TEST_CONTENT_HELPER, false);
 
     mm.addMessageListener("AboutHomeTest:CheckRecordedSearch", function (msg) {
       let data = JSON.parse(msg.data);
       is(data.engineName, engineName, "Detail is search engine name");
 
       getNumberOfSearches(engineName).then(num => {
@@ -170,17 +170,17 @@ let gTests = [
 {
   desc: "Check cached snippets are shown if cached version is current",
   setup: function (aSnippetsMap)
   {
     aSnippetsMap.set("snippets", "test");
   },
   run: function (aSnippetsMap)
   {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
 
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element");
     is(snippetsElt.innerHTML, "test", "Cached snippet is present.");
 
     is(aSnippetsMap.get("snippets"), "test", "snippets still cached");
     is(aSnippetsMap.get("snippets-cached-version"),
        AboutHomeUtils.snippetsVersion,
@@ -193,17 +193,17 @@ let gTests = [
   desc: "Check if the 'Know Your Rights default snippet is shown when 'browser.rights.override' pref is set",
   beforeRun: function ()
   {
     Services.prefs.setBoolPref("browser.rights.override", false);
   },
   setup: function () { },
   run: function (aSnippetsMap)
   {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let showRights = AboutHomeUtils.showKnowYourRights;
 
     ok(showRights, "AboutHomeUtils.showKnowYourRights should be TRUE");
 
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element");
     is(snippetsElt.getElementsByTagName("a")[0].href, "about:rights", "Snippet link is present.");
 
@@ -215,17 +215,17 @@ let gTests = [
   desc: "Check if the 'Know Your Rights default snippet is NOT shown when 'browser.rights.override' pref is NOT set",
   beforeRun: function ()
   {
     Services.prefs.setBoolPref("browser.rights.override", true);
   },
   setup: function () { },
   run: function (aSnippetsMap)
   {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let rightsData = AboutHomeUtils.knowYourRightsData;
 
     ok(!rightsData, "AboutHomeUtils.knowYourRightsData should be FALSE");
 
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element");
     ok(snippetsElt.getElementsByTagName("a")[0].href != "about:rights", "Snippet link should not point to about:rights.");
 
@@ -247,17 +247,17 @@ let gTests = [
       if (aData != "engine-added")
         return;
 
       if (engine.name != "POST Search")
         return;
 
       // Ready to execute the tests!
       let needle = "Search for something awesome.";
-      let document = gBrowser.selectedTab.linkedBrowser.contentDocument;
+      let document = gBrowser.selectedBrowser.contentDocument;
       let searchText = document.getElementById("searchText");
 
       // We're about to change the search engine. Once the change has
       // propagated to the about:home content, we want to perform a search.
       let mutationObserver = new MutationObserver(function (mutations) {
         for (let mutation of mutations) {
           if (mutation.attributeName == "searchEngineName") {
             searchText.value = needle;
@@ -299,17 +299,17 @@ let gTests = [
 
 {
   desc: "Make sure that a page can't imitate about:home",
   setup: function () { },
   run: function (aSnippetsMap)
   {
     let deferred = Promise.defer();
 
-    let browser = gBrowser.selectedTab.linkedBrowser;
+    let browser = gBrowser.selectedBrowser;
     waitForLoad(() => {
       let button = browser.contentDocument.getElementById("settings");
       ok(button, "Found settings button in test page");
       button.click();
 
       // It may take a few turns of the event loop before the window
       // is displayed, so we wait.
       function check(n) {
@@ -382,50 +382,50 @@ let gTests = [
 },
 {
   desc: "Cmd+k should focus the search box in the page when the search box in the toolbar is absent",
   setup: function () {
     // Remove the search bar from toolbar
     CustomizableUI.removeWidgetFromArea("search-container");
   },
   run: Task.async(function* () {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let logo = doc.getElementById("brandLogo");
     let searchInput = doc.getElementById("searchText");
 
     EventUtils.synthesizeMouseAtCenter(logo, {});
     isnot(searchInput, doc.activeElement, "Search input should not be the active element.");
 
     EventUtils.synthesizeKey("k", { accelKey: true });
     yield promiseWaitForCondition(() => doc.activeElement === searchInput);
     is(searchInput, doc.activeElement, "Search input should be the active element.");
     CustomizableUI.reset();
   })
 },
 {
   desc: "Cmd+k should focus the search box in the toolbar when it's present",
   setup: function () {},
   run: Task.async(function* () {
-    let logo = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementById("brandLogo");
+    let logo = gBrowser.selectedBrowser.contentDocument.getElementById("brandLogo");
     let doc = window.document;
     let searchInput = doc.getElementById("searchbar").textbox.inputField;
 
     EventUtils.synthesizeMouseAtCenter(logo, {});
     isnot(searchInput, doc.activeElement, "Search bar should not be the active element.");
 
     EventUtils.synthesizeKey("k", { accelKey: true });
     yield promiseWaitForCondition(() => doc.activeElement === searchInput);
     is(searchInput, doc.activeElement, "Search bar should be the active element.");
   })
 },
 {
   desc: "Sync button should open about:accounts page with `abouthome` entrypoint",
   setup: function () {},
   run: Task.async(function* () {
-    let syncButton = gBrowser.selectedTab.linkedBrowser.contentDocument.getElementById("sync");
+    let syncButton = gBrowser.selectedBrowser.contentDocument.getElementById("sync");
     yield EventUtils.synthesizeMouseAtCenter(syncButton, {}, gBrowser.contentWindow);
 
     yield promiseTabLoadEvent(gBrowser.selectedTab, null, "load");
     is(gBrowser.currentURI.spec, "about:accounts?entrypoint=abouthome",
       "Entry point should be `abouthome`.");
   })
 },
 {
--- a/browser/base/content/test/general/browser_aboutSyncProgress.js
+++ b/browser/base/content/test/general/browser_aboutSyncProgress.js
@@ -6,48 +6,48 @@ const {classes: Cc, interfaces: Ci, util
 Cu.import("resource://services-sync/main.js");
 
 let gTests = [ {
   desc: "Makes sure the progress bar appears if firstSync pref is set",
   setup: function () {
     Services.prefs.setCharPref("services.sync.firstSync", "newAccount");
   },
   run: function () {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let progressBar = doc.getElementById("uploadProgressBar");
 
     let win = doc.defaultView;
     isnot(win.getComputedStyle(progressBar).display, "none", "progress bar should be visible");
     executeSoon(runNextTest);
   }
 },
 
 {
   desc: "Makes sure the progress bar is hidden if firstSync pref is not set",
   setup: function () {
     Services.prefs.clearUserPref("services.sync.firstSync");
     is(Services.prefs.getPrefType("services.sync.firstSync"),
        Ci.nsIPrefBranch.PREF_INVALID, "pref DNE" );
   },
   run: function () {
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let progressBar = doc.getElementById("uploadProgressBar");
 
     let win = doc.defaultView;
     is(win.getComputedStyle(progressBar).display, "none",
        "progress bar should not be visible");
     executeSoon(runNextTest);
   }
 },
 {
   desc: "Makes sure the observer updates are reflected in the progress bar",
   setup: function () {
   },
   run: function () {
-     let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+     let doc = gBrowser.selectedBrowser.contentDocument;
      let progressBar = doc.getElementById("uploadProgressBar");
 
      Services.obs.notifyObservers(null, "weave:engine:sync:finish", null);
      Services.obs.notifyObservers(null, "weave:engine:sync:error", null);
 
      let received = progressBar.getAttribute("value");
 
      is(received, 2, "progress bar received correct notifications");
@@ -59,17 +59,17 @@ let gTests = [ {
   setup: function (){
   },
   run: function () {
     function onTabClosed() {
       ok(true, "received TabClose notification");
       gBrowser.tabContainer.removeEventListener("TabClose", onTabClosed, false);
       executeSoon(runNextTest);
     }
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
     let button = doc.getElementById('closeButton');
     let window = doc.defaultView;
     gBrowser.tabContainer.addEventListener("TabClose", onTabClosed, false);
     EventUtils.sendMouseEvent({type: "click"}, button, window);
   }
 },
 ];
 
--- a/browser/base/content/test/general/browser_bug561636.js
+++ b/browser/base/content/test/general/browser_bug561636.js
@@ -84,17 +84,17 @@ function()
 
       // Clean-up
       gBrowser.removeTab(gBrowser.selectedTab);
       nextTest();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that, when an invalid form is submitted,
  * the invalid element is focused and a popup appears.
  */
 function()
 {
@@ -119,17 +119,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that, when an invalid form is submitted,
  * the first invalid element is focused and a popup appears.
  */
 function()
 {
@@ -154,17 +154,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that, we hide the popup by interacting with the
  * invalid element if the element becomes valid.
  */
 function()
 {
@@ -195,17 +195,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that, we don't hide the popup by interacting with the
  * invalid element if the element is still invalid.
  */
 function()
 {
@@ -236,17 +236,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that we can hide the popup by blurring the invalid
  * element.
  */
 function()
 {
@@ -277,17 +277,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that we can hide the popup by pressing TAB.
  */
 function()
 {
   let uri = getDocHeader() + "<form target='t' action='data:text/html,'><input id='i' required><input id='s' type='submit'></form>" + getDocFooter();
@@ -317,17 +317,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that the popup will hide if we move to another tab.
  */
 function()
 {
   let uri = getDocHeader() + "<form target='t' action='data:text/html,'><input id='i' required><input id='s' type='submit'></form>" + getDocFooter();
@@ -359,17 +359,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that nothing happen if the invalid form is
  * submitted in a background tab.
  */
 
 function()
@@ -400,17 +400,17 @@ function()
   Services.obs.addObserver(gObserver, "invalidformsubmit", false);
 
   tab.linkedBrowser.addEventListener("load", function(e) {
     // Ignore load events from the iframe.
     if (tab.linkedBrowser.contentDocument == e.target) {
       let browser = e.currentTarget;
       browser.removeEventListener("load", arguments.callee, true);
 
-      isnot(gBrowser.selectedTab.linkedBrowser, browser,
+      isnot(gBrowser.selectedBrowser, browser,
             "This tab should have been loaded in background");
       executeSoon(function() {
         browser.contentDocument.getElementById('s').click();
       });
     }
   }, true);
 
   tab.linkedBrowser.loadURI(uri);
@@ -444,17 +444,17 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 /**
  * In this test, we check that the message is correctly updated when it changes.
  */
 function()
 {
   let uri = getDocHeader() + "<form target='t' action='data:text/html,'><input type='email' required id='i'><input id='s' type='submit'></form>" + getDocFooter();
@@ -493,12 +493,12 @@ function()
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 },
 
 ];
--- a/browser/base/content/test/general/browser_bug595507.js
+++ b/browser/base/content/test/general/browser_bug595507.js
@@ -31,10 +31,10 @@ function test()
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(function() {
       gBrowser.contentDocument.getElementsByTagName('iframe')[0].contentDocument
         .getElementById('s').click();
     });
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 }
--- a/browser/base/content/test/general/browser_devices_get_user_media.js
+++ b/browser/base/content/test/general/browser_devices_get_user_media.js
@@ -794,17 +794,17 @@ let gTests = [
   }
 },
 
 {
   desc: "'Always Allow' ignored and not shown on http pages",
   run: function checkNoAlwaysOnHttp() {
     // Load an http page instead of the https version.
     let deferred = Promise.defer();
-    let browser = gBrowser.selectedTab.linkedBrowser;
+    let browser = gBrowser.selectedBrowser;
     browser.addEventListener("load", function onload() {
       browser.removeEventListener("load", onload, true);
       deferred.resolve();
     }, true);
     content.location = content.location.href.replace("https://", "http://");
     yield deferred.promise;
 
     // Initially set both permissions to 'allow'.
--- a/browser/base/content/test/general/browser_notification_tab_switching.js
+++ b/browser/base/content/test/general/browser_notification_tab_switching.js
@@ -41,17 +41,17 @@ function onLoad() {
       notification.addEventListener("show", onAlertShowing);
     });
 
     function waitUntilNewWindowHasFocus() {
       if (!win.newWindow.document.hasFocus()) {
         setTimeout(waitUntilNewWindowHasFocus, 50);
       } else {
         // Focus another window so that new window gets blur event.
-        gBrowser.selectedTab.linkedBrowser.contentWindow.focus();
+        gBrowser.selectedBrowser.contentWindow.focus();
       }
     }
     win.newWindow.focus();
     waitUntilNewWindowHasFocus();
   });
 }
 
 function onAlertShowing() {
@@ -83,13 +83,13 @@ function openSecondNotification() {
   isnot(gBrowser.selectedTab, tab, "Notification page loaded as a background tab");
   let win = tab.linkedBrowser.contentWindow.wrappedJSObject;
   notification = win.showNotification2();
   notification.addEventListener("show", onAlertShowing);
 }
 
 function onTabSelect() {
   gBrowser.tabContainer.removeEventListener("TabSelect", onTabSelect);
-  is(gBrowser.selectedTab.linkedBrowser.contentWindow.location.href, notificationURL,
+  is(gBrowser.selectedBrowser.contentWindow.location.href, notificationURL,
      "Notification tab should be selected.");
 
   finish();
 }
--- a/browser/base/content/test/newtab/browser_newtab_bug991210.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug991210.js
@@ -13,17 +13,17 @@ function runTests() {
       this.callback = callback;
     },
     addObserver: function() {},
   };
   NewTabUtils.links.addProvider(afterLoadProvider);
 
   // wait until about:newtab loads before calling provider callback
   addNewTabPageTab();
-  let browser = gWindow.gBrowser.selectedTab.linkedBrowser;
+  let browser = gWindow.gBrowser.selectedBrowser;
   yield browser.addEventListener("load", function onLoad() {
     browser.removeEventListener("load", onLoad, true);
     // afterLoadProvider.callback has to be called asynchronously to make grid
     // initilize after "load" event was handled
     executeSoon(() => afterLoadProvider.callback([]));
   }, true);
 
   let {_cellMargin, _cellHeight, _cellWidth, node} = getGrid();
--- a/browser/base/content/test/social/browser_aboutHome_activation.js
+++ b/browser/base/content/test/social/browser_aboutHome_activation.js
@@ -62,17 +62,17 @@ let gTests = [
   setup: function (aSnippetsMap)
   {
     // This must be some incorrect xhtml code.
     aSnippetsMap.set("snippets", snippet);
   },
   run: function (aSnippetsMap)
   {
     let deferred = Promise.defer();
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
 
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element");
     ok(!!doc.getElementById("activationSnippet"),
        "The snippet is present.");
 
     activateProvider(gBrowser.selectedTab, true, function() {
       ok(SocialSidebar.provider, "provider activated");
@@ -94,17 +94,17 @@ let gTests = [
   setup: function (aSnippetsMap)
   {
     // This must be some incorrect xhtml code.
     aSnippetsMap.set("snippets", snippet2);
   },
   run: function (aSnippetsMap)
   {
     let deferred = Promise.defer();
-    let doc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    let doc = gBrowser.selectedBrowser.contentDocument;
 
     let snippetsElt = doc.getElementById("snippets");
     ok(snippetsElt, "Found snippets element");
     ok(!!doc.getElementById("activationSnippet"),
        "The snippet is present.");
 
     activateProvider(gBrowser.selectedTab, false, function() {
       ok(SocialSidebar.provider, "provider activated");
--- a/browser/base/content/test/social/browser_social_marks.js
+++ b/browser/base/content/test/social/browser_social_marks.js
@@ -59,17 +59,17 @@ function test() {
     });
   });
 }
 
 var tests = {
   testButtonDisabledOnActivate: function(next) {
     // starting on about:blank page, share should be visible but disabled when
     // adding provider
-    is(gBrowser.selectedTab.linkedBrowser.currentURI.spec, "about:blank");
+    is(gBrowser.selectedBrowser.currentURI.spec, "about:blank");
     SocialService.addProvider(manifest2, function(provider) {
       is(provider.origin, manifest2.origin, "provider is installed");
       let id = SocialMarks._toolbarHelper.idFromOrigin(manifest2.origin);
       let widget = CustomizableUI.getWidget(id).forWindow(window)
       ok(widget.node, "button added to widget set");
 
       // bypass widget go directly to dom, check attribute states
       let button = document.getElementById(id);
--- a/browser/components/customizableui/test/browser_967000_button_sync.js
+++ b/browser/components/customizableui/test/browser_967000_button_sync.js
@@ -26,25 +26,25 @@ function openAboutAccountsFromMenuPanel(
     UITour.originTabs.get(window).add(gBrowser.selectedTab);
   }
 
   let syncButton = document.getElementById("sync-button");
   ok(syncButton, "The Sync button was added to the Panel Menu");
 
   let deferred = Promise.defer();
   let handler = (e) => {
-    if (e.originalTarget != gBrowser.selectedTab.linkedBrowser.contentDocument ||
+    if (e.originalTarget != gBrowser.selectedBrowser.contentDocument ||
         e.target.location.href == "about:blank") {
       info("Skipping spurious 'load' event for " + e.target.location.href);
       return;
     }
-    gBrowser.selectedTab.linkedBrowser.removeEventListener("load", handler, true);
+    gBrowser.selectedBrowser.removeEventListener("load", handler, true);
     deferred.resolve();
   }
-  gBrowser.selectedTab.linkedBrowser.addEventListener("load", handler, true);
+  gBrowser.selectedBrowser.addEventListener("load", handler, true);
 
   syncButton.click();
   yield deferred.promise;
   newTab = gBrowser.selectedTab;
 
   is(gBrowser.currentURI.spec, "about:accounts?entrypoint=" + entryPoint,
     "Firefox Sync page opened with `menupanel` entrypoint");
   ok(!isPanelUIOpen(), "The panel closed");
--- a/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js
+++ b/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js
@@ -34,23 +34,23 @@ let observer = {
 };
 Services.obs.addObserver(observer, "uri-visit-saved", false);
 
 function test()
 {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab(PAGE_URL);
   let frameCount = 0;
-  gBrowser.selectedTab.linkedBrowser.addEventListener("DOMContentLoaded",
+  gBrowser.selectedBrowser.addEventListener("DOMContentLoaded",
     function (event)
     {
       // Wait for all the frames.
       if (frameCount++ < 2)
         return;
-      gBrowser.selectedTab.linkedBrowser.removeEventListener("DOMContentLoaded", arguments.callee, false)
+      gBrowser.selectedBrowser.removeEventListener("DOMContentLoaded", arguments.callee, false)
       gTabLoaded = true;
       maybeClickLink();
     }, false
   );
 }
 
 function maybeClickLink() {
   if (gTabLoaded && gLeftFrameVisited) {
--- a/browser/devtools/debugger/test/browser_dbg_navigation.js
+++ b/browser/devtools/debugger/test/browser_dbg_navigation.js
@@ -45,17 +45,17 @@ function testNavigate([aGrip, aResponse]
       outstanding[0].resolve();
     } else {
       ok(true, "Tab finished navigating.");
       gClient.removeListener("tabNavigated", onTabNavigated);
       outstanding[1].resolve();
     }
   });
 
-  gBrowser.selectedTab.linkedBrowser.loadURI(TAB2_URL);
+  gBrowser.selectedBrowser.loadURI(TAB2_URL);
   return promise.all(outstanding.map(e => e.promise))
                 .then(() => aGrip.actor);
 }
 
 function testDetach(aActor) {
   let deferred = promise.defer();
 
   gClient.addOneTimeListener("tabDetached", (aType, aPacket) => {
--- a/browser/devtools/eyedropper/test/browser_eyedropper_basic.js
+++ b/browser/devtools/eyedropper/test/browser_eyedropper_basic.js
@@ -55,17 +55,17 @@ function* inspectPage(dropper, click=tru
   yield dropper.open();
 
   info("dropper opened");
 
   let target = document.documentElement;
   let win = window;
 
   // get location of the <div> in the content, offset from browser window
-  let box = gBrowser.selectedTab.linkedBrowser.getBoundingClientRect();
+  let box = gBrowser.selectedBrowser.getBoundingClientRect();
   let x = box.left + 100;
   let y = box.top + 100;
 
   EventUtils.synthesizeMouse(target, x, y, { type: "mousemove" }, win);
 
   yield dropperLoaded(dropper);
 
   EventUtils.synthesizeMouse(target, x + 10, y + 10, { type: "mousemove" }, win);
--- a/browser/devtools/eyedropper/test/browser_eyedropper_cmd.js
+++ b/browser/devtools/eyedropper/test/browser_eyedropper_cmd.js
@@ -36,17 +36,17 @@ function inspectAndWaitForCopy() {
   }, DIV_COLOR);
 }
 
 function inspectPage() {
   let target = document.documentElement;
   let win = window;
 
   // get location of the <div> in the content, offset from browser window
-  let box = gBrowser.selectedTab.linkedBrowser.getBoundingClientRect();
+  let box = gBrowser.selectedBrowser.getBoundingClientRect();
   let x = box.left + 100;
   let y = box.top + 100;
 
   let dropper = EyedropperManager.getInstance(window);
 
   return dropperStarted(dropper).then(() => {
     EventUtils.synthesizeMouse(target, x, y, { type: "mousemove" }, win);
 
--- a/browser/devtools/inspector/test/head.js
+++ b/browser/devtools/inspector/test/head.js
@@ -621,17 +621,17 @@ function once(target, eventName, useCapt
 /**
  * Wait for a content -> chrome message on the message manager (the window
  * messagemanager is used).
  * @param {String} name The message name
  * @return {Promise} A promise that resolves to the response data when the
  * message has been received
  */
 function waitForContentMessage(name) {
-  let mm = gBrowser.selectedTab.linkedBrowser.messageManager;
+  let mm = gBrowser.selectedBrowser.messageManager;
 
   let def = promise.defer();
   mm.addMessageListener(name, function onMessage(msg) {
     mm.removeMessageListener(name, onMessage);
     def.resolve(msg);
   });
   return def.promise;
 }
@@ -650,17 +650,17 @@ function wait(ms) {
  * @param {Object} data Optional data to send along
  * @param {Object} objects Optional CPOW objects to send along
  * @param {Boolean} expectResponse If set to false, don't wait for a response
  * with the same name from the content script. Defaults to true.
  * @return {Promise} Resolves to the response data if a response is expected,
  * immediately resolves otherwise
  */
 function executeInContent(name, data={}, objects={}, expectResponse=true) {
-  let mm = gBrowser.selectedTab.linkedBrowser.messageManager;
+  let mm = gBrowser.selectedBrowser.messageManager;
 
   mm.sendAsyncMessage(name, data, objects);
   if (expectResponse) {
     return waitForContentMessage(name);
   } else {
     return promise.resolve();
   }
 }
--- a/browser/devtools/shared/DeveloperToolbar.jsm
+++ b/browser/devtools/shared/DeveloperToolbar.jsm
@@ -212,17 +212,17 @@ let CommandUtils = {
         return this.target.tab.ownerDocument.defaultView;
       },
 
       get chromeDocument() {
         return this.chromeWindow.document;
       },
 
       get window() {
-        return this.chromeWindow.gBrowser.selectedTab.linkedBrowser.contentWindow;
+        return this.chromeWindow.gBrowser.selectedBrowser.contentWindow;
       },
 
       get document() {
         return this.window.document;
       }
     };
   },
 };
--- a/browser/devtools/styleeditor/test/browser_styleeditor_reload.js
+++ b/browser/devtools/styleeditor/test/browser_styleeditor_reload.js
@@ -18,17 +18,17 @@ const COL_NO = 3;
 let gContentWin;
 let gUI;
 
 function test()
 {
   waitForExplicitFinish();
 
   addTabAndOpenStyleEditors(2, function(panel) {
-    gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
+    gContentWin = gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
     gUI = panel.UI;
     gUI.editors[0].getSourceEditor().then(runTests);
   });
 
   content.location = TESTCASE_URI;
 }
 
 function runTests()
--- a/browser/devtools/styleeditor/test/browser_styleeditor_selectstylesheet.js
+++ b/browser/devtools/styleeditor/test/browser_styleeditor_selectstylesheet.js
@@ -18,17 +18,17 @@ const COL_NO  = 0;
 let gContentWin;
 let gUI;
 
 function test()
 {
   waitForExplicitFinish();
 
   addTabAndOpenStyleEditors(2, function(panel) {
-    gContentWin = gBrowser.selectedTab.linkedBrowser.contentWindow.wrappedJSObject;
+    gContentWin = gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
     gUI = panel.UI;
     gUI.editors[0].getSourceEditor().then(runTests);
   });
 
   content.location = TESTCASE_URI;
 }
 
 function runTests()
--- a/browser/devtools/styleinspector/test/browser_ruleview_eyedropper.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_eyedropper.js
@@ -119,17 +119,17 @@ function openEyedropper(view, swatch) {
   return deferred.promise;
 }
 
 function inspectPage(dropper, click=true) {
   let target = document.documentElement;
   let win = window;
 
   // get location of the content, offset from browser window
-  let box = gBrowser.selectedTab.linkedBrowser.getBoundingClientRect();
+  let box = gBrowser.selectedBrowser.getBoundingClientRect();
   let x = box.left + 1;
   let y = box.top + 1;
 
   return dropperStarted(dropper).then(() => {
     EventUtils.synthesizeMouse(target, x, y, { type: "mousemove" }, win);
 
     return dropperLoaded(dropper).then(() => {
       EventUtils.synthesizeMouse(target, x + 10, y + 10, { type: "mousemove" }, win);
--- a/browser/devtools/styleinspector/test/head.js
+++ b/browser/devtools/styleinspector/test/head.js
@@ -337,17 +337,17 @@ function wait(ms) {
  * messagemanager is used).
  * @param {String} name The message name
  * @return {Promise} A promise that resolves to the response data when the
  * message has been received
  */
 function waitForContentMessage(name) {
   info("Expecting message " + name + " from content");
 
-  let mm = gBrowser.selectedTab.linkedBrowser.messageManager;
+  let mm = gBrowser.selectedBrowser.messageManager;
 
   let def = promise.defer();
   mm.addMessageListener(name, function onMessage(msg) {
     mm.removeMessageListener(name, onMessage);
     def.resolve(msg.data);
   });
   return def.promise;
 }
@@ -361,17 +361,17 @@ function waitForContentMessage(name) {
  * @param {Object} objects Optional CPOW objects to send along
  * @param {Boolean} expectResponse If set to false, don't wait for a response
  * with the same name from the content script. Defaults to true.
  * @return {Promise} Resolves to the response data if a response is expected,
  * immediately resolves otherwise
  */
 function executeInContent(name, data={}, objects={}, expectResponse=true) {
   info("Sending message " + name + " to content");
-  let mm = gBrowser.selectedTab.linkedBrowser.messageManager;
+  let mm = gBrowser.selectedBrowser.messageManager;
 
   mm.sendAsyncMessage(name, data, objects);
   if (expectResponse) {
     return waitForContentMessage(name);
   } else {
     return promise.resolve();
   }
 }
--- a/browser/modules/test/browser_UITour_detach_tab.js
+++ b/browser/modules/test/browser_UITour_detach_tab.js
@@ -47,17 +47,17 @@ let tests = [
     Services.obs.addObserver(function onBrowserDelayedStartup(aWindow) {
       Services.obs.removeObserver(onBrowserDelayedStartup, "browser-delayed-startup-finished");
       browserStartupDeferred.resolve(aWindow);
     }, "browser-delayed-startup-finished", false);
 
     // NB: we're using this rather than gContentWindow.document because the latter wouldn't
     // have an XRayWrapper, and we need to compare this to the doc we get using this method
     // later on...
-    gContentDoc = gBrowser.selectedTab.linkedBrowser.contentDocument;
+    gContentDoc = gBrowser.selectedBrowser.contentDocument;
     gContentDoc.addEventListener("visibilitychange", onVisibilityChange, false);
     gContentAPI.showHighlight("appMenu");
 
     yield elementVisiblePromise(highlight);
 
     gBrowser.replaceTabWithWindow(gBrowser.selectedTab);
 
     gContentWindow = yield browserStartupDeferred.promise;
--- a/browser/modules/test/browser_UITour_sync.js
+++ b/browser/modules/test/browser_UITour_sync.js
@@ -39,17 +39,17 @@ let tests = [
   // The showFirefoxAccounts API is sync related, so we test that here too...
   function test_firefoxAccounts(done) {
     // This test will load about:accounts, and we don't want that to hit the
     // network.
     Services.prefs.setCharPref("identity.fxaccounts.remote.signup.uri",
                                "https://example.com/");
 
     loadUITourTestPage(function(contentWindow) {
-      let tabBrowser = gBrowser.selectedTab.linkedBrowser;
+      let tabBrowser = gBrowser.selectedBrowser;
       // This command will replace the current tab - so add a load event
       // handler which will fire when that happens.
       tabBrowser.addEventListener("load", function onload(evt) {
         tabBrowser.removeEventListener("load", onload, true);
 
         ise(tabBrowser.contentDocument.location.href,
             "about:accounts?action=signup&entrypoint=uitour",
             "about:accounts should have replaced the tab");
--- a/dom/tests/browser/browser_autofocus_preference.js
+++ b/dom/tests/browser/browser_autofocus_preference.js
@@ -1,24 +1,24 @@
 function test() {
   waitForExplicitFinish();
 
   var prefs = Components.classes["@mozilla.org/preferences-service;1"]
             .getService(Components.interfaces.nsIPrefBranch);
   var gAutofocusPref = prefs.getBoolPref("browser.autofocus");
   prefs.setBoolPref("browser.autofocus", false);
 
-  gBrowser.selectedTab.linkedBrowser.addEventListener("load", function () {
-    gBrowser.selectedTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
+  gBrowser.selectedBrowser.addEventListener("load", function () {
+    gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
 
     executeSoon(function () {
-      is(gBrowser.selectedTab.linkedBrowser.contentDocument.activeElement,
-         gBrowser.selectedTab.linkedBrowser.contentDocument.body,
+      is(gBrowser.selectedBrowser.contentDocument.activeElement,
+         gBrowser.selectedBrowser.contentDocument.body,
          "foo");
 
       prefs.setBoolPref("browser.autofocus", gAutofocusPref);
 
       finish();
     });
   }, true);
 
-  gBrowser.selectedTab.linkedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>");
+  gBrowser.selectedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>");
 }
--- a/layout/base/tests/browser_bug617076.js
+++ b/layout/base/tests/browser_bug617076.js
@@ -52,10 +52,10 @@ function test1() {
 
         // done
         executeSoon(finish);
       });
     }, 0);
   }, true);
 
   gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
+  gBrowser.selectedBrowser.loadURI(uri);
 }
--- a/toolkit/components/places/tests/browser/browser_notfound.js
+++ b/toolkit/components/places/tests/browser/browser_notfound.js
@@ -7,17 +7,17 @@ function test() {
 
   gBrowser.selectedTab = gBrowser.addTab();
   registerCleanupFunction(function() {
     gBrowser.removeCurrentTab();
   });
   const TEST_URL = "http://mochi.test:8888/notFoundPage.html";
   // Used to verify errors are not marked as typed.
   PlacesUtils.history.markPageAsTyped(NetUtil.newURI(TEST_URL));
-  gBrowser.selectedTab.linkedBrowser.loadURI(TEST_URL);
+  gBrowser.selectedBrowser.loadURI(TEST_URL);
 
   // Create and add history observer.
   let historyObserver = {
     onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
                       aTransitionType) {
       PlacesUtils.history.removeObserver(historyObserver);
       info("Received onVisit: " + aURI.spec);
       fieldForUrl(aURI, "frecency", function (aFrecency) {
--- a/toolkit/components/places/tests/browser/browser_redirect.js
+++ b/toolkit/components/places/tests/browser/browser_redirect.js
@@ -7,17 +7,17 @@ function test() {
 
   const REDIRECT_URI = NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/browser/redirect.sjs");
   const TARGET_URI = NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/browser/redirect-target.html");
 
   gBrowser.selectedTab = gBrowser.addTab();
   registerCleanupFunction(function() {
     gBrowser.removeCurrentTab();
   });
-  gBrowser.selectedTab.linkedBrowser.loadURI(REDIRECT_URI.spec);
+  gBrowser.selectedBrowser.loadURI(REDIRECT_URI.spec);
 
   // Create and add history observer.
   let historyObserver = {
     _redirectNotified: false,
     onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
                       aTransitionType) {
       info("Received onVisit: " + aURI.spec);
 
--- a/toolkit/components/places/tests/browser/browser_visited_notfound.js
+++ b/toolkit/components/places/tests/browser/browser_visited_notfound.js
@@ -21,17 +21,17 @@ function test() {
       continueTest(aFrecency);
     });
   });
 }
 
 function continueTest(aOldFrecency) {
   // Used to verify errors are not marked as typed.
   PlacesUtils.history.markPageAsTyped(TEST_URI);
-  gBrowser.selectedTab.linkedBrowser.loadURI(TEST_URI.spec);
+  gBrowser.selectedBrowser.loadURI(TEST_URI.spec);
 
   // Create and add history observer.
   let historyObserver = {
     __proto__: NavHistoryObserver.prototype,
     onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
                       aTransitionType) {
       PlacesUtils.history.removeObserver(historyObserver);
       info("Received onVisit: " + aURI.spec);
--- a/toolkit/components/thumbnails/test/head.js
+++ b/toolkit/components/thumbnails/test/head.js
@@ -88,17 +88,17 @@ function addTab(aURI, aCallback) {
   whenLoaded(tab.linkedBrowser, aCallback);
 }
 
 /**
  * Loads a new URI into the currently selected tab.
  * @param aURI The URI to load.
  */
 function navigateTo(aURI) {
-  let browser = gBrowser.selectedTab.linkedBrowser;
+  let browser = gBrowser.selectedBrowser;
   whenLoaded(browser);
   browser.loadURI(aURI);
 }
 
 /**
  * Continues the current test execution when a load event for the given element
  * has been received.
  * @param aElement The DOM element to listen on.
--- a/toolkit/devtools/server/tests/browser/browser_navigateEvents.js
+++ b/toolkit/devtools/server/tests/browser/browser_navigateEvents.js
@@ -121,17 +121,17 @@ function test() {
       events.on(tabActor, "will-navigate", function (data) {
         assertEvent("will-navigate", data);
       });
       events.on(tabActor, "navigate", function (data) {
         assertEvent("navigate", data);
       });
 
       // Start listening for page load events
-      let browser = gBrowser.selectedTab.linkedBrowser;
+      let browser = gBrowser.selectedBrowser;
       browser.addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
       browser.addEventListener("load", onLoad, true);
 
       // Listen for alert() call being made in navigate-first during unload
       waitForOnBeforeUnloadDialog(browser, function (btnLeave, btnStay) {
         assertEvent("unload-dialog");
         // accept to quit this page to another
         btnLeave.click();
@@ -141,17 +141,17 @@ function test() {
       assertEvent("load-new-document");
       content.location = URL2;
     });
 
   });
 }
 
 function cleanup() {
-  let browser = gBrowser.selectedTab.linkedBrowser;
+  let browser = gBrowser.selectedBrowser;
   browser.removeEventListener("DOMContentLoaded", onDOMContentLoaded);
   browser.removeEventListener("load", onLoad);
   client.close(function () {
     Services.obs.addObserver(httpObserver, "http-on-modify-request", false);
     DebuggerServer.destroy();
     finish();
   });
 }
--- a/toolkit/devtools/tests/mochitest/test_devtools_extensions.html
+++ b/toolkit/devtools/tests/mochitest/test_devtools_extensions.html
@@ -51,17 +51,17 @@
           include: TEST_URL,
           contentScriptWhen: 'ready',
           contentScript: 'null;'
         });
 
         tabs.open({
           url: TEST_URL,
           onLoad: function(tab) {
-            let id = getInnerId(getMostRecentBrowserWindow().gBrowser.selectedTab.linkedBrowser.contentWindow);
+            let id = getInnerId(getMostRecentBrowserWindow().gBrowser.selectedBrowser.contentWindow);
 
             // getting
             is(contentGlobals.getContentGlobals({
               'inner-window-id': id
             }).length, 1, 'found a global for inner-id = ' + id);
 
             Services.obs.addObserver(function observer(subject, topic, data) {
               if (id == subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data) {
--- a/toolkit/mozapps/extensions/test/browser/browser_experiments.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_experiments.js
@@ -175,17 +175,17 @@ add_task(function* testExperimentLearnMo
 
   is_element_visible(btn, "Learn more button visible.");
 
   let deferred = Promise.defer();
   window.addEventListener("DOMContentLoaded", function onLoad(event) {
     info("Telemetry privacy policy window opened.");
     window.removeEventListener("DOMContentLoaded", onLoad, false);
 
-    let browser = gBrowser.selectedTab.linkedBrowser;
+    let browser = gBrowser.selectedBrowser;
     let expected = Services.prefs.getCharPref("toolkit.telemetry.infoURL");
     Assert.equal(browser.currentURI.spec, expected, "New tab should have loaded privacy policy.");
     browser.contentWindow.close();
 
     Services.prefs.clearUserPref("toolkit.telemetry.infoURL");
 
     deferred.resolve();
   }, false);
--- a/toolkit/mozapps/extensions/test/browser/browser_tabsettings.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_tabsettings.js
@@ -41,17 +41,17 @@ add_test(function() {
   addon.parentNode.ensureElementIsVisible(addon);
 
   var button = gManagerWindow.document.getAnonymousElementByAttribute(addon, "anonid", "preferences-btn");
   is_element_visible(button, "Preferences button should be visible");
 
   if (gUseInContentUI) {
     EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
 
-    var browser = gBrowser.selectedTab.linkedBrowser;
+    var browser = gBrowser.selectedBrowser;
     browser.addEventListener("DOMContentLoaded", function() {
       browser.removeEventListener("DOMContentLoaded", arguments.callee, false);
       is(browser.currentURI.spec, addon.mAddon.optionsURL, "New tab should have loaded the options URL");
       browser.contentWindow.close();
       run_next_test();
     }, false);
     return;
   }