jsparser: disable net requests

This commit is contained in:
jean-emmanuel 2019-04-07 12:43:02 +02:00
parent bb46538e89
commit d8cbaf944b

View file

@ -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(`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-eval';">`)
sandbox.contentWindow.document.close()
// init infinite loop guard
loopProtect.alias = '__protect'
loopProtect.hit = function(line){