Skip to content

Commit

Permalink
fix: bug where no-sandbox is required (#72)
Browse files Browse the repository at this point in the history
- always use no-sandbox flag on puppeteer

Closes: #69
  • Loading branch information
jaron-l authored Dec 9, 2024
1 parent e70b8a8 commit 11d071a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ async function getBrowser() {
],
};

// always use no sandbox
// should be safe since only 3 known domains are accessed
// required for docker and pi deployments and anyone that wants to use as root
puppeteerOpts.args!.push("--no-sandbox");
if (isPi()) {
puppeteerOpts.executablePath = "/usr/bin/chromium";
puppeteerOpts.args!.push("--no-sandbox");
} else {
// https://stackoverflow.com/questions/74251875/puppeteer-error-an-executablepath-or-channel-must-be-specified-for-puppete
puppeteerOpts.executablePath = executablePath();
Expand Down

0 comments on commit 11d071a

Please sign in to comment.