Firefox: load content-scripts on extension start

pull/2/head
Deathamns 9 years ago committed by gorhill
parent 539826310b
commit fffec145b9

@ -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'
);
}
};
/******************************************************************************/

Loading…
Cancel
Save