mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 17:09:07 +08:00
rename findAndLocateExistedChromiumExecutableSync function name to findAndLocateUserInstalledChromiumExecutableSync
This commit is contained in:
+3
-3
@@ -118,7 +118,7 @@ export const getAnyAvailablePuppeteerExecutable = async (): Promise<BrowserInfo
|
|||||||
}
|
}
|
||||||
// find existed browser - the one maybe actively installed by user or ship with os like Edge on windows
|
// find existed browser - the one maybe actively installed by user or ship with os like Edge on windows
|
||||||
try {
|
try {
|
||||||
const existedOne = await findAndLocateExistedChromiumExecutable()
|
const existedOne = await findAndLocateUserInstalledChromiumExecutable()
|
||||||
await saveLastUsedAndAvailableBrowserInfo(existedOne)
|
await saveLastUsedAndAvailableBrowserInfo(existedOne)
|
||||||
// save its path
|
// save its path
|
||||||
return existedOne
|
return existedOne
|
||||||
@@ -139,7 +139,7 @@ export const getAnyAvailablePuppeteerExecutable = async (): Promise<BrowserInfo
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function findAndLocateExistedChromiumExecutableSync(): Promise<BrowserInfo> {
|
export async function findAndLocateUserInstalledChromiumExecutableSync(): Promise<BrowserInfo> {
|
||||||
const exceptChromiumMainVersion = Number(EXPECT_CHROMIUM_BUILD_ID.split('.')[0])
|
const exceptChromiumMainVersion = Number(EXPECT_CHROMIUM_BUILD_ID.split('.')[0])
|
||||||
// For windows, try to find Edge(chromium)
|
// For windows, try to find Edge(chromium)
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === 'win32') {
|
||||||
@@ -193,7 +193,7 @@ export async function findAndLocateExistedChromiumExecutableSync(): Promise<Brow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function findAndLocateExistedChromiumExecutable(): Promise<BrowserInfo> {
|
export async function findAndLocateUserInstalledChromiumExecutable(): Promise<BrowserInfo> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const worker: Worker = new CheckAndLocateExistedChromiumExecutableWorker()
|
const worker: Worker = new CheckAndLocateExistedChromiumExecutableWorker()
|
||||||
worker.once('message', (data) => {
|
worker.once('message', (data) => {
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import { parentPort } from 'node:worker_threads'
|
import { parentPort } from 'node:worker_threads'
|
||||||
import { findAndLocateExistedChromiumExecutableSync } from '../index'
|
import { findAndLocateUserInstalledChromiumExecutableSync } from '../index'
|
||||||
;(async () => {
|
;(async () => {
|
||||||
try {
|
try {
|
||||||
const result = await findAndLocateExistedChromiumExecutableSync()
|
const result = await findAndLocateUserInstalledChromiumExecutableSync()
|
||||||
parentPort?.postMessage({
|
parentPort?.postMessage({
|
||||||
type: 'RESULT',
|
type: 'RESULT',
|
||||||
data: result
|
data: result
|
||||||
|
|||||||
Reference in New Issue
Block a user