mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-26 18:50:10 +08:00
fix(boss): 修复治理公告弹窗关闭 timing 问题
用 waitForSelector 替换 page.$(),等待弹窗异步渲染完成后再点击; 超时由 60s 缩短为 10s,避免弹窗未出现时长时间阻塞。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,9 @@ export async function initPuppeteer () {
|
||||
*/
|
||||
async function dismissGovernanceNoticeDialog (page) {
|
||||
try {
|
||||
const confirmBtn = await page.$(GOVERNANCE_NOTICE_DIALOG_CONFIRM_BTN_SELECTOR)
|
||||
const confirmBtn = await page
|
||||
.waitForSelector(GOVERNANCE_NOTICE_DIALOG_CONFIRM_BTN_SELECTOR, { timeout: 10000 })
|
||||
.catch(() => null)
|
||||
if (!confirmBtn) return
|
||||
logInfo('[boss-auto-browse] 检测到「治理公告」弹窗,点击「我已知晓」关闭...')
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user