1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Allow scriptlets to be injected in about:blank

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2963
This commit is contained in:
Raymond Hill 2023-11-16 17:07:48 -05:00
parent c292a90b90
commit 3fd2588650
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -159,14 +159,11 @@ const mainWorldInjector = (( ) => {
const parts = [
'(',
function(injector, details) {
if ( typeof self.uBO_scriptletsInjected === 'string' ) { return; }
const doc = document;
if (
doc.location === null ||
details.hostname !== doc.location.hostname ||
typeof self.uBO_scriptletsInjected === 'string'
) {
return;
}
if ( doc.location === null ) { return; }
const hostname = doc.location.hostname;
if ( hostname !== '' && details.hostname !== hostname ) { return; }
injector(doc, details);
return 0;
}.toString(),
@ -193,14 +190,11 @@ const isolatedWorldInjector = (( ) => {
const parts = [
'(',
function(details) {
if ( self.uBO_isolatedScriptlets === 'done' ) { return; }
const doc = document;
if (
doc.location === null ||
details.hostname !== doc.location.hostname ||
self.uBO_isolatedScriptlets === 'done'
) {
return;
}
if ( doc.location === null ) { return; }
const hostname = doc.location.hostname;
if ( hostname !== '' && details.hostname !== hostname ) { return; }
const isolatedScriptlets = function(){};
isolatedScriptlets();
self.uBO_isolatedScriptlets = 'done';