From b64f411e4abc0681d2f66a3a3f8da0dbdfb73fe3 Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Thu, 29 May 2025 01:55:35 +0800 Subject: [PATCH] add edge to block list due to `https://github.com/geekgeekrun/geekgeekrun/issues/5` --- .../utils/browser-history.ts | 7 ++++ .../utils/puppeteer-executable/index.ts | 33 ++----------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/packages/ui/src/main/flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/utils/browser-history.ts b/packages/ui/src/main/flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/utils/browser-history.ts index 744c574..07f088c 100644 --- a/packages/ui/src/main/flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/utils/browser-history.ts +++ b/packages/ui/src/main/flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/utils/browser-history.ts @@ -33,6 +33,13 @@ export const getLastUsedAndAvailableBrowser = async (): Promise { - let puppeteerManager - puppeteerManager = await import('@puppeteer/browsers') + const puppeteerManager = await import('@puppeteer/browsers') return puppeteerManager } @@ -129,33 +127,8 @@ export const getAnyAvailablePuppeteerExecutable = async (): Promise { const exceptChromiumMainVersion = Number(EXPECT_CHROMIUM_BUILD_ID.split('.')[0]) - // For windows, try to find Edge(chromium) - if (os.platform() === 'win32') { - // TODO: handle windows - const edgeExecutableLocation = path.join( - process.env['ProgramFiles(x86)']!, - 'Microsoft/Edge/Application', - 'msedge.exe' - ) - if (fs.existsSync(edgeExecutableLocation)) { - try { - const version = await getExecutableFileVersion(edgeExecutableLocation) - const mainVersion = Number(version.split('.')[0]) - if (mainVersion >= exceptChromiumMainVersion) { - return { - executablePath: edgeExecutableLocation, - browser: `Edge ${version}` - } - } - } catch (err) { - console.log(err) - } - } - } - - // For other, use findChrome - let findChrome: typeof import('find-chrome-bin').findChrome - findChrome = (await import('find-chrome-bin')).findChrome + const findChrome: typeof import('find-chrome-bin').findChrome = (await import('find-chrome-bin')) + .findChrome const targetBrowser = await findChrome({ min: exceptChromiumMainVersion })