diff --git a/src/js/resources/prevent-settimeout.js b/src/js/resources/prevent-settimeout.js index c137f0dc7..289c44659 100644 --- a/src/js/resources/prevent-settimeout.js +++ b/src/js/resources/prevent-settimeout.js @@ -95,8 +95,8 @@ export function preventSetTimeout( proxyApplyFn('setTimeout', function(context) { const { callArgs } = context; const a = callArgs[0] instanceof Function - ? String(safe.Function_toString(callArgs[0])) - : String(callArgs[0]); + ? safe.String(safe.Function_toString(callArgs[0])) + : safe.String(callArgs[0]); const b = callArgs[1]; if ( needleRaw === '' && range.unbound() ) { safe.uboLog(logPrefix, `Called:\n${a}\n${b}`); @@ -159,8 +159,8 @@ export function preventSetInterval( proxyApplyFn('setInterval', function(context) { const { callArgs } = context; const a = callArgs[0] instanceof Function - ? String(safe.Function_toString(callArgs[0])) - : String(callArgs[0]); + ? safe.String(safe.Function_toString(callArgs[0])) + : safe.String(callArgs[0]); const b = callArgs[1]; if ( needleRaw === '' && range.unbound() ) { safe.uboLog(logPrefix, `Called:\n${a}\n${b}`); @@ -212,8 +212,8 @@ export function preventRequestAnimationFrame( proxyApplyFn('requestAnimationFrame', function(context) { const { callArgs } = context; const a = callArgs[0] instanceof Function - ? String(safe.Function_toString(callArgs[0])) - : String(callArgs[0]); + ? safe.String(safe.Function_toString(callArgs[0])) + : safe.String(callArgs[0]); if ( needleRaw === '' ) { safe.uboLog(logPrefix, `Called:\n${a}`); } else if ( reNeedle.test(a) !== needleNot ) { diff --git a/src/js/resources/safe-self.js b/src/js/resources/safe-self.js index 3766f3e19..6b6d72eeb 100644 --- a/src/js/resources/safe-self.js +++ b/src/js/resources/safe-self.js @@ -50,6 +50,7 @@ export function safeSelf() { 'RegExp_test': self.RegExp.prototype.test, 'RegExp_exec': self.RegExp.prototype.exec, 'Request_clone': self.Request.prototype.clone, + 'String': self.String, 'String_fromCharCode': String.fromCharCode, 'String_split': String.prototype.split, 'XMLHttpRequest': self.XMLHttpRequest,