1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00

Add uBO: prefix to logged output in some scriptlets

As per request.
This commit is contained in:
Raymond Hill 2020-04-28 11:19:26 -04:00
parent d462b50cec
commit 5227013a8e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -240,7 +240,7 @@
apply: function(target, thisArg, args) { apply: function(target, thisArg, args) {
const type = args[0].toString(); const type = args[0].toString();
const handler = String(args[1]); const handler = String(args[1]);
log('addEventListener("%s", %s)', type, handler); log('uBO: addEventListener("%s", %s)', type, handler);
return target.apply(thisArg, args); return target.apply(thisArg, args);
} }
} }
@ -308,7 +308,7 @@
if ( log !== undefined ) { if ( log !== undefined ) {
const json = JSON.stringify(r, null, 2); const json = JSON.stringify(r, null, 2);
if ( reLogNeedle.test(json) ) { if ( reLogNeedle.test(json) ) {
log(location.hostname, json); log('uBO:', location.hostname, json);
} }
return r; return r;
} }
@ -851,7 +851,7 @@
new Proxy(peerConnectionProto.createDataChannel, { new Proxy(peerConnectionProto.createDataChannel, {
apply: function(target, thisArg, args) { apply: function(target, thisArg, args) {
if ( isGoodConfig(target, args[1]) === false ) { if ( isGoodConfig(target, args[1]) === false ) {
log(args[1]); log('uBO:', args[1]);
return Reflect.apply(target, thisArg, args.slice(0, 1)); return Reflect.apply(target, thisArg, args.slice(0, 1));
} }
return Reflect.apply(target, thisArg, args); return Reflect.apply(target, thisArg, args);
@ -861,7 +861,7 @@
new Proxy(peerConnectionCtor, { new Proxy(peerConnectionCtor, {
construct: function(target, args) { construct: function(target, args) {
if ( isGoodConfig(target, args[0]) === false ) { if ( isGoodConfig(target, args[0]) === false ) {
log(args[0]); log('uBO:', args[0]);
return Reflect.construct(target); return Reflect.construct(target);
} }
return Reflect.construct(target, args); return Reflect.construct(target, args);