Created
October 26, 2018 01:29
-
-
Save pindlebot/faa24a2ad3fcf107085a8dd0780fde79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chromeLauncher = require('chrome-launcher') | |
const DEFAULT_ARGS = [ | |
'--disable-background-networking', | |
'--disable-background-timer-throttling', | |
'--disable-breakpad', | |
'--disable-client-side-phishing-detection', | |
'--disable-default-apps', | |
'--disable-dev-shm-usage', | |
'--disable-extensions', | |
'--disable-features=site-per-process', | |
'--disable-hang-monitor', | |
'--disable-popup-blocking', | |
'--disable-prompt-on-repost', | |
'--disable-sync', | |
'--disable-translate', | |
'--metrics-recording-only', | |
'--no-first-run', | |
'--safebrowsing-disable-auto-update' | |
]; | |
const chromeFlags = DEFAULT_ARGS.concat([ | |
'--disable-gpu', | |
'--no-sandbox', | |
'--disable-setuid-sandbox', | |
'--headless', | |
'--disable-gpu', | |
'--hide-scrollbars', | |
'--mute-audio' | |
]) | |
process.env.CHROME_PATH = '/usr/bin/google-chrome' | |
module.exports = () => { | |
return chromeLauncher.launch({ | |
chromeFlags, | |
port: 9222 | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment