()
| 85 | } |
| 86 | |
| 87 | async function initChrome() { |
| 88 | const platform = os.platform(); |
| 89 | |
| 90 | if (platform === 'linux') { |
| 91 | process.env.XVFBARGS = '-screen 0, 1024x768x16'; |
| 92 | process.env.LIGHTHOUSE_CHROMIUM_PATH = 'chromium-browser'; |
| 93 | const child = spawn('xvfb start', [{detached: true, stdio: ['ignore']}]); |
| 94 | child.unref(); |
| 95 | // wait for chrome to load then continue |
| 96 | await wait(3000); |
| 97 | return child; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | async function launchChrome(headless) { |
| 102 | return await chromeLauncher.launch({ |