1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 08:37:11 +02:00
This commit is contained in:
gorhill 2015-06-23 14:50:45 -04:00
parent 6c1678d718
commit c596e6c0e1

View File

@ -998,10 +998,9 @@ var tabWatcher = (function() {
} }
var tabContainer = null; var tabContainer = null;
if ( tabBrowser.deck ) { if ( tabBrowser.deck ) { // Fennec
// Fennec
tabContainer = tabBrowser.deck; tabContainer = tabBrowser.deck;
} else if ( tabBrowser.tabContainer ) { } else if ( tabBrowser.tabContainer ) { // Firefox
tabContainer = tabBrowser.tabContainer; tabContainer = tabBrowser.tabContainer;
} }
if ( tabContainer ) { if ( tabContainer ) {
@ -1025,6 +1024,7 @@ var tabWatcher = (function() {
browser = browserFromTarget(tab); browser = browserFromTarget(tab);
tabId = browserToTabIdMap.get(browser); tabId = browserToTabIdMap.get(browser);
if ( tabId !== undefined ) { if ( tabId !== undefined ) {
removeBrowserEntry(tabId, browser);
tabIdToBrowserMap.delete(tabId); tabIdToBrowserMap.delete(tabId);
} }
browserToTabIdMap.delete(browser); browserToTabIdMap.delete(browser);
@ -1036,6 +1036,11 @@ var tabWatcher = (function() {
observe: function(win, topic) { observe: function(win, topic) {
if ( topic === 'domwindowopened' ) { if ( topic === 'domwindowopened' ) {
win.addEventListener('DOMContentLoaded', onWindowLoad); win.addEventListener('DOMContentLoaded', onWindowLoad);
return;
}
if ( topic === 'domwindowclosed' ) {
onWindowUnload.call(win);
return;
} }
} }
}; };