Uh oh!
There was an error while loading. Please reload this page.
fix: improve button click handling when login - #199
Conversation
bbbugg
commented
Jun 4, 2026
- fix[反馈]:启用账号失败 #196
There was a problem hiding this comment.
Pull request overview
This PR addresses account enablement/login flows being blocked by interstitial UI (notably Google’s “Continue to the app” prompt) by integrating lightweight, DOM-based button clicking into the WebSocket initialization wait loop in BrowserManager.
Changes:
- Added helpers to detect critical page errors and to click “Continue to the app” / “Launch” buttons when visible.
- Updated the WebSocket init wait loop to periodically attempt these clicks while waiting for the connection to come up.
- Removed the older popup/launch helper methods and their call sites, consolidating the behavior into the wait loop.
Comments suppressed due to low confidence (1)
src/core/BrowserManager.js:315
- The
_waitForWebSocketInitdocblock now understates the method’s behavior: it actively tries to click "Continue to the app" and "Launch" buttons in addition to waiting/monitoring logs. Updating the comment helps future maintainers understand why DOM-clicking happens in this loop.
/**
* Helper: Wait for WebSocket initialization with log monitoring
* Supports abort for background tasks and context deletion
* @param {object} page - Playwright page object
* @param {string} logPrefix - Log prefix for messages
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/core/BrowserManager.js:339
- The JSDoc for
_waitForWebSocketInitsays it returnsfalsewhen “aborted”, but the implementation throwsContextAbortedError(and can also re-throw critical page/browser errors). Please update the documentation to reflect the actual return/throw behavior so callers know they must handle exceptions.
/**
* Helper: Wait for WebSocket initialization with log monitoring
* Supports abort for background tasks and context deletion
* @param {object} page - Playwright page object
* @param {string} logPrefix - Log prefix for messages
* @param {number} timeout - Timeout in milliseconds (default 120000)
* @param {number} authIndex - Auth index for this context (default -1)
* @param {boolean} isBackgroundTask - Whether this is a background preload task (default false)
* @returns {Promise<boolean>} true if initialization succeeded, false if failed or aborted
*/
Uh oh!
There was an error while loading. Please reload this page.