1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 15:33:38 +01:00

Improve abort-on-stack-trace scriptlet

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3314
This commit is contained in:
Raymond Hill 2024-07-28 10:44:17 -04:00
parent 76246f2c59
commit ec633887dd
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -64,6 +64,7 @@ function safeSelf() {
'RegExp_test': self.RegExp.prototype.test,
'RegExp_exec': self.RegExp.prototype.exec,
'Request_clone': self.Request.prototype.clone,
'String_fromCharCode': String.fromCharCode,
'XMLHttpRequest': self.XMLHttpRequest,
'addEventListener': self.EventTarget.prototype.addEventListener,
'removeEventListener': self.EventTarget.prototype.removeEventListener,
@ -211,7 +212,7 @@ builtinScriptlets.push({
function getExceptionToken() {
const safe = safeSelf();
const token =
String.fromCharCode(Date.now() % 26 + 97) +
safe.String_fromCharCode(Date.now() % 26 + 97) +
safe.Math_floor(safe.Math_random() * 982451653 + 982451653).toString(36);
const oe = self.onerror;
self.onerror = function(msg, ...args) {