diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 7a85730ff..40157849f 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -680,6 +680,12 @@ var winWatcher = (function() { if ( !win || windowToIdMap.delete(win) !== true ) { return; } + // https://github.com/uBlockOrigin/uAssets/issues/567 + // We need to cleanup if and only if the window being closed is + // the actual top window. + if ( win.gBrowser && win.gBrowser.ownerGlobal !== win ) { + return; + } if ( typeof api.onCloseWindow === 'function' ) { api.onCloseWindow(win); }