mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-25 11:52:51 +01:00
Improve trusted-override-element-method
scriptlet
Support `debug` as valid `disposition` value: to trigger a `debugger` statement, but only if uBO's logger is opened. Related feedback: https://github.com/uBlockOrigin/uAssets/issues/25510#issuecomment-2395446342
This commit is contained in:
parent
1f45902a61
commit
160d7f3c33
@ -222,7 +222,7 @@ function safeSelf() {
|
||||
safe.sendToLogger = (type, ...args) => {
|
||||
const text = safe.toLogText(type, ...args);
|
||||
if ( text === undefined ) { return; }
|
||||
console.log(`uBO${text}`);
|
||||
safe.log(`uBO ${text}`);
|
||||
};
|
||||
}
|
||||
return safe;
|
||||
@ -5286,6 +5286,9 @@ function trustedOverrideElementMethod(
|
||||
}
|
||||
safe.uboLog(logPrefix, 'Overridden');
|
||||
if ( disposition === '' ) { return; }
|
||||
if ( disposition === 'debug' && safe.logLevel !== 0 ) {
|
||||
debugger; // eslint-disable-line no-debugger
|
||||
}
|
||||
if ( disposition === 'throw' ) {
|
||||
throw new ReferenceError();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user