Improve logging information in `prevent-window-open` scriptlet

This commit is contained in:
Raymond Hill 2024-02-02 09:36:08 -05:00
parent 28e1424058
commit b4da81f8d4
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 1 deletions

View File

@ -2679,9 +2679,12 @@ function noWindowOpenIf(
apply: function(target, thisArg, args) {
const haystack = args.join(' ');
if ( rePattern.test(haystack) !== targetMatchResult ) {
if ( safe.logLevel > 1 ) {
safe.uboLog(logPrefix, `Allowed (${args.join(', ')})`);
}
return Reflect.apply(target, thisArg, args);
}
safe.uboLog(logPrefix, 'Prevented');
safe.uboLog(logPrefix, `Prevented (${args.join(', ')})`);
if ( autoRemoveAfter < 0 ) { return null; }
const decoyElem = decoy === 'obj'
? createDecoy('object', 'data', ...args)