From ec633887dddd7cb98249959f81918e7cb325b8cb Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 28 Jul 2024 10:44:17 -0400 Subject: [PATCH] Improve `abort-on-stack-trace` scriptlet Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3314 --- assets/resources/scriptlets.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index c8af8f229..6e9dcd60e 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -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) {