mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-05 23:47:54 +08:00
bypass anti debug of target site
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
"@geekgeekrun/dingtalk-plugin": "workspace:*",
|
||||
"@geekgeekrun/geek-auto-start-chat-with-boss": "workspace:*",
|
||||
"@geekgeekrun/launch-bosszhipin-login-page-with-preload-extension": "workspace:*",
|
||||
"@geekgeekrun/puppeteer-extra-plugin-laodeng": "workspace:*",
|
||||
"@geekgeekrun/sqlite-plugin": "workspace:*",
|
||||
"@geekgeekrun/utils": "workspace:*",
|
||||
"JSONStream": "^1.3.5",
|
||||
@@ -43,7 +44,7 @@
|
||||
"mitt": "^3.0.1",
|
||||
"node-machine-id": "^1.1.12",
|
||||
"pinia": "^3.0.2",
|
||||
"puppeteer": "20.1.0",
|
||||
"puppeteer": "24.19.0",
|
||||
"puppeteer-extra-plugin-stealth": "2.11.2",
|
||||
"uuid": "^11.1.0",
|
||||
"vuedraggable": "^4.1.0"
|
||||
@@ -54,7 +55,7 @@
|
||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||
"@inquirer/prompts": "^7.0.1",
|
||||
"@inquirer/select": "^4.0.1",
|
||||
"@puppeteer/browsers": "^2.0.0",
|
||||
"@puppeteer/browsers": "^2.11.0",
|
||||
"@rushstack/eslint-patch": "^1.7.1",
|
||||
"@types/node": "^18.19.9",
|
||||
"@unocss/preset-attributify": "^0.58.5",
|
||||
@@ -88,4 +89,4 @@
|
||||
"vue-router": "^4.2.5",
|
||||
"vue-tsc": "^1.8.27"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface BrowserInfo {
|
||||
executablePath: string
|
||||
}
|
||||
|
||||
const CONFIG_VSERION = 2
|
||||
|
||||
const runtimeFolderPath = path.join(os.homedir(), '.geekgeekrun')
|
||||
export const lastUsedBrowserRecordFilePath = path.join(
|
||||
runtimeFolderPath,
|
||||
@@ -28,8 +30,13 @@ export const getLastUsedAndAvailableBrowser = async (): Promise<BrowserInfo | nu
|
||||
}
|
||||
try {
|
||||
const fileContent = (await fsPromise.readFile(lastUsedBrowserRecordFilePath)).toString()
|
||||
const [path, browser] = fileContent.split('\n').map((it) => it.trim())
|
||||
if (!path || !fs.existsSync(path)) {
|
||||
const [path, browser, configVersion] = fileContent.split('\n').map((it) => it.trim())
|
||||
if (
|
||||
!path ||
|
||||
!fs.existsSync(path) ||
|
||||
!Number(configVersion) ||
|
||||
Number(configVersion) < CONFIG_VSERION
|
||||
) {
|
||||
await removeLastUsedAndAvailableBrowserPath()
|
||||
return null
|
||||
}
|
||||
@@ -57,7 +64,7 @@ export const saveLastUsedAndAvailableBrowserInfo = async (browserInfo: BrowserIn
|
||||
}
|
||||
await fsPromise.writeFile(
|
||||
lastUsedBrowserRecordFilePath,
|
||||
[browserInfo.executablePath, browserInfo.browser].join('\n')
|
||||
[browserInfo.executablePath, browserInfo.browser, CONFIG_VSERION].join('\n')
|
||||
)
|
||||
} catch {
|
||||
console.warn('lastUsedBrowserRecordFile write error')
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ const getPuppeteerManagerModule = async () => {
|
||||
return puppeteerManager
|
||||
}
|
||||
|
||||
const EXPECT_CHROMIUM_BUILD_ID = '113.0.5672.63'
|
||||
const EXPECT_CHROMIUM_BUILD_ID = '139.0.7258.154'
|
||||
const cacheDir = path.join(os.homedir(), '.geekgeekrun', 'cache')
|
||||
|
||||
const getExpectCachedPuppeteerExecutable = async (): Promise<BrowserInfo> => {
|
||||
|
||||
Reference in New Issue
Block a user