mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-23 10:52:43 +01:00
Allow scriptlets to be injected in about:blank
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/2963
This commit is contained in:
parent
c292a90b90
commit
3fd2588650
@ -159,14 +159,11 @@ const mainWorldInjector = (( ) => {
|
|||||||
const parts = [
|
const parts = [
|
||||||
'(',
|
'(',
|
||||||
function(injector, details) {
|
function(injector, details) {
|
||||||
|
if ( typeof self.uBO_scriptletsInjected === 'string' ) { return; }
|
||||||
const doc = document;
|
const doc = document;
|
||||||
if (
|
if ( doc.location === null ) { return; }
|
||||||
doc.location === null ||
|
const hostname = doc.location.hostname;
|
||||||
details.hostname !== doc.location.hostname ||
|
if ( hostname !== '' && details.hostname !== hostname ) { return; }
|
||||||
typeof self.uBO_scriptletsInjected === 'string'
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
injector(doc, details);
|
injector(doc, details);
|
||||||
return 0;
|
return 0;
|
||||||
}.toString(),
|
}.toString(),
|
||||||
@ -193,14 +190,11 @@ const isolatedWorldInjector = (( ) => {
|
|||||||
const parts = [
|
const parts = [
|
||||||
'(',
|
'(',
|
||||||
function(details) {
|
function(details) {
|
||||||
|
if ( self.uBO_isolatedScriptlets === 'done' ) { return; }
|
||||||
const doc = document;
|
const doc = document;
|
||||||
if (
|
if ( doc.location === null ) { return; }
|
||||||
doc.location === null ||
|
const hostname = doc.location.hostname;
|
||||||
details.hostname !== doc.location.hostname ||
|
if ( hostname !== '' && details.hostname !== hostname ) { return; }
|
||||||
self.uBO_isolatedScriptlets === 'done'
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const isolatedScriptlets = function(){};
|
const isolatedScriptlets = function(){};
|
||||||
isolatedScriptlets();
|
isolatedScriptlets();
|
||||||
self.uBO_isolatedScriptlets = 'done';
|
self.uBO_isolatedScriptlets = 'done';
|
||||||
|
Loading…
Reference in New Issue
Block a user