From 47dfb1b22cc3a76807b634ab7ffe490ffd151204 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 22 Jul 2017 16:57:29 -0400 Subject: [PATCH] fix https://github.com/uBlockOrigin/uAssets/issues/567 --- platform/firefox/vapi-background.js | 6 ++++++ 1 file changed, 6 insertions(+) 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); }