fix: improve button click handling when login#199
Merged
Conversation
Member
bbbugg
commented
Jun 4, 2026
- fix [反馈]:启用账号失败 #196
Contributor
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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
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
*/
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.