Skip to content

fix: improve button click handling when login#199

Merged
bbbugg merged 3 commits into
mainfrom
fix/continue-login
Jun 4, 2026
Merged

fix: improve button click handling when login#199
bbbugg merged 3 commits into
mainfrom
fix/continue-login

Conversation

@bbbugg

@bbbugg bbbugg commented Jun 4, 2026

Copy link
Copy Markdown
Member

@bbbugg bbbugg changed the title fix: improve button click handling and add critical error checks fix: improve button click handling when login Jun 4, 2026
@bbbugg bbbugg requested a review from Copilot June 4, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _waitForWebSocketInit docblock 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.

Comment thread src/core/BrowserManager.js
Comment thread src/core/BrowserManager.js
bbbugg and others added 2 commits June 4, 2026 18:58
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/core/BrowserManager.js
Comment thread src/core/BrowserManager.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _waitForWebSocketInit says it returns false when “aborted”, but the implementation throws ContextAbortedError (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
     */

@bbbugg bbbugg merged commit 2d16578 into main Jun 4, 2026
3 checks passed
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

🎉 此 PR 的修改已在版本 v1.3.1 中发布。
🎉 The changes in this PR have been released in version v1.3.1.

@bbbugg bbbugg added the 🐛 Bug Something isn't working label Jun 9, 2026
@bbbugg bbbugg deleted the fix/continue-login branch June 10, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[反馈]:启用账号失败

2 participants