Bug 1597793 - Check if a window is not a popup in ext-utils's onLocationChange. r=snorp
authorAgi Sferro <agi@sferro.dev>
Sat, 25 Jan 2020 07:27:10 +0000
changeset 511762 371b23a6a66559c958155b02ad4cf03a8231e6f6
parent 511761 b1f2823f65c21e556230346eea1cf24c47f224da
child 511763 01769e564085e48c1f882e0333cff94cdf801170
push id37055
push userccoroiu@mozilla.com
push dateSat, 25 Jan 2020 21:38:07 +0000
treeherdermozilla-central@3bc0d683a41c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1597793
milestone74.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 1597793 - Check if a window is not a popup in ext-utils's onLocationChange. r=snorp Differential Revision: https://phabricator.services.mozilla.com/D60986
mobile/android/components/extensions/ext-utils.js
--- a/mobile/android/components/extensions/ext-utils.js
+++ b/mobile/android/components/extensions/ext-utils.js
@@ -84,16 +84,23 @@ class BrowserProgressListener {
    */
   delegate(method, ...args) {
     if (this.listener[method]) {
       this.listener[method](this.browser, ...args);
     }
   }
 
   onLocationChange(webProgress, request, locationURI, flags) {
+    const window = this.browser.ownerGlobal;
+    // GeckoView windows can become popups at any moment, so we need to check
+    // here
+    if (!windowTracker.isBrowserWindow(window)) {
+      return;
+    }
+
     this.delegate("onLocationChange", webProgress, request, locationURI, flags);
   }
   onStateChange(webProgress, request, stateFlags, status) {
     this.delegate("onStateChange", webProgress, request, stateFlags, status);
   }
 }
 
 const PROGRESS_LISTENER_FLAGS =