| 276 | } |
| 277 | |
| 278 | function findChromePath() { |
| 279 | const candidates = [ |
| 280 | process.env.CHROME_PATH, |
| 281 | process.platform === 'darwin' ? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' : null, |
| 282 | process.platform === 'darwin' ? '/Applications/Chromium.app/Contents/MacOS/Chromium' : null, |
| 283 | process.platform === 'win32' |
| 284 | ? 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' |
| 285 | : null, |
| 286 | process.platform === 'win32' |
| 287 | ? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' |
| 288 | : null, |
| 289 | 'google-chrome', |
| 290 | 'chromium', |
| 291 | 'chromium-browser' |
| 292 | ].filter(Boolean) |
| 293 | |
| 294 | return candidates[0] |
| 295 | } |
| 296 | |
| 297 | function startChrome({ debugPort, userDataDir }) { |
| 298 | const chromePath = findChromePath() |