diff --git a/lib/tools.js b/lib/tools.js index edd43296..6dbf3a44 100644 --- a/lib/tools.js +++ b/lib/tools.js @@ -199,8 +199,13 @@ function prepareHtml(html, callback) { if (!(html || '').toString().trim()) { return callback(null, false); } - - jsdom.env(html, (err, win) => { + jsdom.env(false, false, { + html, + features: { + FetchExternalResources: false, // disables resource loading over HTTP / filesystem + ProcessExternalResources: false // do not execute JS within script blocks + } + }, (err, win) => { if (err) { return callback(err); }