mirror of https://github.com/gorhill/uBlock.git
Skip regex-testing context when no context provided
Related issue: - https://github.com/uBlockOrigin/uAssets/issues/18725 Testing the context was causing the deprecated static property RegExp.$1 to be clobbered, causing webpage breakage because this property was subsequently used used by the caller.
This commit is contained in:
parent
8b7a5264de
commit
e0b3b44080
|
@ -295,7 +295,7 @@ function abortCurrentScriptCore(
|
||||||
const e = document.currentScript;
|
const e = document.currentScript;
|
||||||
if ( e instanceof HTMLScriptElement === false ) { return; }
|
if ( e instanceof HTMLScriptElement === false ) { return; }
|
||||||
if ( e === thisScript ) { return; }
|
if ( e === thisScript ) { return; }
|
||||||
if ( reContext.test(e.src) === false ) { return; }
|
if ( context !== '' && reContext.test(e.src) === false ) { return; }
|
||||||
if ( log && e.src !== '' ) { safe.uboLog(`matched src: ${e.src}`); }
|
if ( log && e.src !== '' ) { safe.uboLog(`matched src: ${e.src}`); }
|
||||||
const scriptText = getScriptText(e);
|
const scriptText = getScriptText(e);
|
||||||
if ( reNeedle.test(scriptText) === false ) { return; }
|
if ( reNeedle.test(scriptText) === false ) { return; }
|
||||||
|
|
Loading…
Reference in New Issue