Index: ext/background.js |
=================================================================== |
--- a/ext/background.js |
+++ b/ext/background.js |
@@ -55,21 +55,22 @@ |
nonEmptyPageMaps.delete(this); |
}, |
delete(page) |
{ |
this._delete(page.id); |
} |
}; |
- ext._removeFromAllPageMaps = pageId => |
+ function removeFromAllPageMaps(pageId) |
{ |
for (let pageMap of nonEmptyPageMaps) |
pageMap._delete(pageId); |
- }; |
+ } |
+ |
/* Pages */ |
let Page = ext.Page = function(tab) |
{ |
this.id = tab.id; |
this._url = tab.url && new URL(tab.url); |
@@ -151,17 +152,17 @@ |
} |
function updatePageFrameStructure(frameId, tabId, url, parentFrameId) |
{ |
if (frameId == 0) |
{ |
let page = new Page({id: tabId, url}); |
- ext._removeFromAllPageMaps(tabId); |
+ removeFromAllPageMaps(tabId); |
browser.tabs.get(tabId, () => |
{ |
// If the tab is prerendered, browser.tabs.get() sets |
// browser.runtime.lastError and we have to dispatch the onLoading |
// event, since the onUpdated event isn't dispatched for prerendered |
// tabs. However, we have to keep relying on the onUpdated event for |
// tabs that are already visible. Otherwise browser action changes get |
@@ -274,17 +275,17 @@ |
details.parentFrameId); |
} |
}); |
function forgetTab(tabId) |
{ |
ext.pages.onRemoved._dispatch(tabId); |
- ext._removeFromAllPageMaps(tabId); |
+ removeFromAllPageMaps(tabId); |
framesOfTabs.delete(tabId); |
} |
browser.tabs.onReplaced.addListener((addedTabId, removedTabId) => |
{ |
forgetTab(removedTabId); |
}); |