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

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

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)