Skip to content

Commit

Permalink
✨ feat: fallback to chromium if exec path not found #3103
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Apr 15, 2023
1 parent 88159b8 commit bbbc7b0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/controllers/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,21 @@ async function initBrowser(sessionId?: string, config:any={}, spinner ?: Spin) {
args,
...config,
devtools: false
}).catch(e=>{
spinner?.fail('Error launching browser')
console.error(e)
if(e.message.includes("ENOENT")) {
config.executablePath = executablePath()
console.log("Falling back to chromium:", config.executablePath)
return puppeteer.launch({
headless: true,
args,
...config,
devtools: false
})
}
spinner?.fail(e.message)
throw e;
});
BROWSER_START_TS = Date.now();
//devtools
Expand Down

0 comments on commit bbbc7b0

Please sign in to comment.