From 9a7fd50c65b5b5a5f5f08906f5a4e0bd94d366e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8C=8C?= Date: Wed, 6 Sep 2023 13:00:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20puppeteer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .puppeteerrc.cjs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs index 2f3a7b5..d0fe606 100644 --- a/.puppeteerrc.cjs +++ b/.puppeteerrc.cjs @@ -1,5 +1,5 @@ const os = require("os") -const { existsSync, realpathSync } = require("fs") +const { existsSync } = require("fs") const { execSync } = require("child_process") const arch = os.arch() @@ -11,21 +11,20 @@ if (process.platform == "linux" || process.platform == "android") "chromium", "chromium-browser", "chrome", - "chrome-browser", ]) try { const chromiumPath = execSync(`command -v ${item}`).toString().trim() if (chromiumPath && existsSync(chromiumPath)) { - executablePath = realpathSync(chromiumPath) + executablePath = chromiumPath break } } catch (err) {} if (!executablePath) for (const item of [ - "C:/Program Files/Google/Chrome/Application/chrome.exe", - "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe", "/usr/bin/chromium", "/usr/bin/chromium-browser", - "/snap/bin/chromium", + "/usr/bin/chrome", + "C:/Program Files/Google/Chrome/Application/chrome.exe", + "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe", ]) if (existsSync(item)) { executablePath = item break