jsparser: disable net requests
This commit is contained in:
parent
bb46538e89
commit
d8cbaf944b
1 changed files with 6 additions and 1 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue