From df829cd2fa8dd6f3e54f8c57e1d520d09269c241 Mon Sep 17 00:00:00 2001 From: Jaron <13423952+jaron-l@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:10:45 -0600 Subject: [PATCH] fix: bug where sandbox is not used when in docker - always use 'no-sandbox' --- index.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/index.ts b/index.ts index 6835eb5..14d6ed3 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,6 @@ import puppeteer from "puppeteer-extra"; import StealthPlugin from "puppeteer-extra-plugin-stealth"; import PluginREPL from "puppeteer-extra-plugin-repl"; import { LunchMoney } from "lunch-money"; -import isPi from "detect-rpi"; puppeteer.use(StealthPlugin()); puppeteer.use(PluginREPL()); @@ -28,13 +27,9 @@ async function getBrowser() { ], }; - 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(); - } + puppeteerOpts.args!.push("--no-sandbox"); + // https://stackoverflow.com/questions/74251875/puppeteer-error-an-executablepath-or-channel-must-be-specified-for-puppete + puppeteerOpts.executablePath = executablePath(); return await puppeteer.launch(puppeteerOpts); }