diff --git a/packages/goto/src/index.js b/packages/goto/src/index.js index 7fe16d65c4..5e4b0f20b9 100644 --- a/packages/goto/src/index.js +++ b/packages/goto/src/index.js @@ -56,12 +56,16 @@ module.exports = ({ timeout, ...deviceOpts }) => { const goto = async ( page, - { url, media, adblock = true, headers = {}, waitFor = 0, disableAnimations = true, ...args } + { url, media, adblock = true, headers = {}, waitFor = 0, disableAnimations = true, disableJavaScript = false, ...args } ) => { if (adblock) { await engine.enableBlockingInPage(page) } + if (disableJavaScript) { + await page.setJavaScriptEnabled(false) + } + if (Object.keys(headers).length !== 0) { debug('headers', headers) await page.setExtraHTTPHeaders(headers)