Skip to content

Instantly share code, notes, and snippets.

@pindlebot
Created October 26, 2018 01:29
Show Gist options
  • Save pindlebot/faa24a2ad3fcf107085a8dd0780fde79 to your computer and use it in GitHub Desktop.
Save pindlebot/faa24a2ad3fcf107085a8dd0780fde79 to your computer and use it in GitHub Desktop.
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