Bug 1481471 - Allow browser.tabs extension APIs to find GeckoView windows. r=snorp
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 14 Aug 2018 10:53:49 -0700
changeset 431575 0f4415f29a66170ba4dcd1dcf8ba17a770e74434
parent 431574 9288bcd578ed278f1790580458cc741bfb65acba
child 431576 7d9cc6236b1f4f08f4a748c720c80d1e1325390a
push id106486
push usermbrubeck@mozilla.com
push dateTue, 14 Aug 2018 23:57:36 +0000
treeherdermozilla-inbound@7d9cc6236b1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1481471
milestone63.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 1481471 - Allow browser.tabs extension APIs to find GeckoView windows. r=snorp Differential Revision: https://phabricator.services.mozilla.com/D3354
mobile/android/components/extensions/ext-utils.js
--- a/mobile/android/components/extensions/ext-utils.js
+++ b/mobile/android/components/extensions/ext-utils.js
@@ -166,16 +166,21 @@ class ProgressListenerWrapper {
 
 class WindowTracker extends WindowTrackerBase {
   constructor(...args) {
     super(...args);
 
     this.progressListeners = new DefaultWeakMap(() => new WeakMap());
   }
 
+  get topWindow() {
+    return Services.wm.getMostRecentWindow("navigator:browser") ||
+      Services.wm.getMostRecentWindow("navigator:geckoview");
+  }
+
   addProgressListener(window, listener) {
     let listeners = this.progressListeners.get(window);
     if (!listeners.has(listener)) {
       let wrapper = new ProgressListenerWrapper(window, listener);
       listeners.set(listener, wrapper);
     }
   }