Fix error when site has only exception scriptlet filters

Cause by recent refactoring of scriptlet-related code.
This commit is contained in:
Raymond Hill 2024-01-26 20:57:26 -05:00
parent be1f938c17
commit cb6ff38f86
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 5 additions and 8 deletions

View File

@ -259,12 +259,6 @@ export class ScriptletFilteringEngine {
$mainWorldMap.clear();
$isolatedWorldMap.clear();
if ( scriptletDetails.mainWorld === '' ) {
if ( scriptletDetails.isolatedWorld === '' ) {
return { filters: scriptletDetails.filters };
}
}
const scriptletGlobals = options.scriptletGlobals || {};
if ( options.debug ) {

View File

@ -335,10 +335,10 @@ export class ScriptletFilteringEngineEx extends ScriptletFilteringEngine {
}
const contentScript = [];
if ( scriptletDetails.mainWorld !== '' ) {
if ( scriptletDetails.mainWorld ) {
contentScript.push(mainWorldInjector.assemble(hostname, scriptletDetails));
}
if ( scriptletDetails.isolatedWorld !== '' ) {
if ( scriptletDetails.isolatedWorld ) {
contentScript.push(isolatedWorldInjector.assemble(hostname, scriptletDetails));
}
@ -373,6 +373,9 @@ export class ScriptletFilteringEngineEx extends ScriptletFilteringEngine {
contentScriptRegisterer.unregister(hostname);
return;
}
if ( Boolean(scriptletDetails.code) === false ) {
return scriptletDetails;
}
const contentScript = [ scriptletDetails.code ];
if ( logger.enabled ) {