1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-01 18:10:17 +12:00

Firefox: load content-scripts on extension start

This commit is contained in:
Deathamns 2015-03-12 18:20:48 +01:00 committed by gorhill
parent 539826310b
commit fffec145b9

View file

@ -1829,7 +1829,22 @@ vAPI.lastError = function() {
// in already opened web pages, to remove whatever nuisance could make it to
// the web pages before uBlock was ready.
vAPI.onLoadAllCompleted = function() {};
vAPI.onLoadAllCompleted = function() {
var µb = µBlock;
for ( var tab of this.tabs.getAll() ) {
// We're insterested in only the tabs that were already loaded
if ( tab.hasAttribute('pending') ) {
continue;
}
var tabId = this.tabs.getTabId(tab);
var browser = getBrowserForTab(tab);
µb.bindTabToPageStats(tabId, browser.currentURI.spec);
browser.messageManager.sendAsyncMessage(
location.host + '-load-completed'
);
}
};
/******************************************************************************/