Allow scriptlets to be injected in `about:blank` · gorhill/uBlock@3fd2588 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 3fd2588

Browse files
committed
Allow scriptlets to be injected in about:blank
Related issue: uBlockOrigin/uBlock-issues#2963
1 parent c292a90 commit 3fd2588

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/js/scriptlet-filtering.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,11 @@ const mainWorldInjector = (( ) => {
159159
const parts = [
160160
'(',
161161
function(injector, details) {
162+
if ( typeof self.uBO_scriptletsInjected === 'string' ) { return; }
162163
const doc = document;
163-
if (
164-
doc.location === null ||
165-
details.hostname !== doc.location.hostname ||
166-
typeof self.uBO_scriptletsInjected === 'string'
167-
) {
168-
return;
169-
}
164+
if ( doc.location === null ) { return; }
165+
const hostname = doc.location.hostname;
166+
if ( hostname !== '' && details.hostname !== hostname ) { return; }
170167
injector(doc, details);
171168
return 0;
172169
}.toString(),
@@ -193,14 +190,11 @@ const isolatedWorldInjector = (( ) => {
193190
const parts = [
194191
'(',
195192
function(details) {
193+
if ( self.uBO_isolatedScriptlets === 'done' ) { return; }
196194
const doc = document;
197-
if (
198-
doc.location === null ||
199-
details.hostname !== doc.location.hostname ||
200-
self.uBO_isolatedScriptlets === 'done'
201-
) {
202-
return;
203-
}
195+
if ( doc.location === null ) { return; }
196+
const hostname = doc.location.hostname;
197+
if ( hostname !== '' && details.hostname !== hostname ) { return; }
204198
const isolatedScriptlets = function(){};
205199
isolatedScriptlets();
206200
self.uBO_isolatedScriptlets = 'done';

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.