From b74d94bc390e9f53f2ab1f5610c46421f71d2baf Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 7 Apr 2019 12:43:02 +0200 Subject: [PATCH] jsparser: disable net requests --- src/client/app/widgets/utils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/app/widgets/utils.js b/src/client/app/widgets/utils.js index 6e2f6293..c02ae036 100644 --- a/src/client/app/widgets/utils.js +++ b/src/client/app/widgets/utils.js @@ -112,9 +112,14 @@ module.exports = { loopProtect = require('loop-protect') sandbox.style.display = 'none' - sandbox.sandbox = 'allow-scripts allow-same-origin' + sandbox.sandbox = 'allow-same-origin' document.body.appendChild(sandbox) + // block requests + sandbox.contentWindow.document.open() + sandbox.contentWindow.document.write(``) + sandbox.contentWindow.document.close() + // init infinite loop guard loopProtect.alias = '__protect' loopProtect.hit = function(line){