Browse Source

Firefox: load content-scripts on extension start

pull/2/head
Deathamns 10 years ago
committed by gorhill
parent
commit
fffec145b9
  1. 17
      platform/firefox/vapi-background.js

17
platform/firefox/vapi-background.js

@ -1829,7 +1829,22 @@ vAPI.lastError = function() {
// in already opened web pages, to remove whatever nuisance could make it to // in already opened web pages, to remove whatever nuisance could make it to
// the web pages before uBlock was ready. // 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