diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 68d896f49..a3083293f 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -60,8 +60,11 @@ function safeSelf() { 'addEventListener': self.EventTarget.prototype.addEventListener, 'removeEventListener': self.EventTarget.prototype.removeEventListener, 'fetch': self.fetch, - 'JSON_parse': self.JSON.parse.bind(self.JSON), - 'JSON_stringify': self.JSON.stringify.bind(self.JSON), + 'JSON': self.JSON, + 'JSON_parseFn': self.JSON.parse, + 'JSON_stringifyFn': self.JSON.stringify, + 'JSON_parse': (...args) => safe.JSON_parseFn.call(safe.JSON, ...args), + 'JSON_stringify': (...args) => safe.JSON_stringifyFn.call(safe.JSON, ...args), 'log': console.log.bind(console), uboLog(...args) { if ( scriptletGlobals.has('canDebug') === false ) { return; }