1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

this fixes #456: another unrelated bug unveil from previous fix

This commit is contained in:
gorhill 2015-01-01 20:58:19 -05:00
parent dfe82ed8dd
commit 2a7e9f8d98
3 changed files with 21 additions and 5 deletions

View File

@ -33,6 +33,13 @@
self.vAPI = self.vAPI || {}; self.vAPI = self.vAPI || {};
// https://github.com/gorhill/uBlock/issues/456
// Already injected?
if ( vAPI.vapiClient ) {
return;
}
vAPI.vapiClient = true;
var chrome = self.chrome; var chrome = self.chrome;
var vAPI = self.vAPI; var vAPI = self.vAPI;

View File

@ -33,6 +33,13 @@ if ( vAPI.canExecuteContentScript() !== true ) {
throw "uBlock> contentscript-end.js > Skipping " + location.protocol; throw "uBlock> contentscript-end.js > Skipping " + location.protocol;
} }
// https://github.com/gorhill/uBlock/issues/456
// Already injected?
if ( vAPI.contentscriptEnd ) {
return;
}
vAPI.contentscriptEnd = true;
/******************************************************************************/ /******************************************************************************/
var messager = vAPI.messaging.channel('contentscript-end.js'); var messager = vAPI.messaging.channel('contentscript-end.js');

View File

@ -44,6 +44,13 @@ if ( vAPI.canExecuteContentScript() !== true ) {
return; return;
} }
// https://github.com/gorhill/uBlock/issues/456
// Already injected?
if ( vAPI.contentscriptStart ) {
return;
}
vAPI.contentscriptStart = true;
/******************************************************************************/ /******************************************************************************/
var localMessager = vAPI.messaging.channel('contentscript-start.js'); var localMessager = vAPI.messaging.channel('contentscript-start.js');
@ -55,11 +62,6 @@ var localMessager = vAPI.messaging.channel('contentscript-start.js');
// These can be inserted before the DOM is loaded. // These can be inserted before the DOM is loaded.
var cosmeticFilters = function(details) { var cosmeticFilters = function(details) {
// Maybe uBlock's style tag was already injected?
var style = document.getElementById('ublock-preload-1ae7a5f130fc79b4fdb8a4272d9426b5');
if ( style !== null ) {
return;
}
var donthideCosmeticFilters = {}; var donthideCosmeticFilters = {};
var hideCosmeticFilters = {}; var hideCosmeticFilters = {};
style = document.createElement('style'); style = document.createElement('style');