Bug 1493628 - only update the 'current' outerWindowID when the browser window is the foreground window, r=dao
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 26 Sep 2018 11:57:07 +0000
changeset 496767 513ebcc0f395531d2bfea60154515dee8c7987d0
parent 496766 8c9d2be6d47e0a530e161430f06f47678c25fe3f
child 496768 d86f6268d191ed31554a6b0b9d6d70e2891df83b
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1493628
milestone64.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 1493628 - only update the 'current' outerWindowID when the browser window is the foreground window, r=dao Differential Revision: https://phabricator.services.mozilla.com/D6898
browser/modules/BrowserWindowTracker.jsm
--- a/browser/modules/BrowserWindowTracker.jsm
+++ b/browser/modules/BrowserWindowTracker.jsm
@@ -30,17 +30,18 @@ var _trackedWindows = [];
 function debug(s) {
   if (DEBUG) {
     dump("-*- UpdateTopLevelContentWindowIDHelper: " + s + "\n");
   }
 }
 
 function _updateCurrentContentOuterWindowID(browser) {
   if (!browser.outerWindowID ||
-      browser.outerWindowID === _lastTopLevelWindowID) {
+      browser.outerWindowID === _lastTopLevelWindowID ||
+      browser.ownerGlobal != _trackedWindows[0]) {
     return;
   }
 
   debug("Current window uri=" + browser.currentURI.spec +
         " id=" + browser.outerWindowID);
 
   _lastTopLevelWindowID = browser.outerWindowID;
   let windowIDWrapper = Cc["@mozilla.org/supports-PRUint64;1"]