Repository navigation
feat(browser): sign in in a real window - #139
Merged
Merged
Conversation
Some sites refuse to sign in to a browser that tells them a program drives it. The bot's browser now keeps navigator.webdriver false (--disable-blink-features=AutomationControlled) and overrides the user agent with its userAgentData metadata, read once from chrome://version, so the brands are no longer empty. No script is injected into pages; outerWidth stays 0. Spec 21.2, 21.3 and 19 record what was measured.
Google and other sites refuse to sign in to the bot's browser even with the owner in control, because it is still a headless Edge driven over DevTools. The new browser.window request closes it and opens the bot's profile in a common Edge window with no DevTools; the owner signs in there and closes it. The bot's tools wait meanwhile, an open request for help counts as done when the window closes, and the next tool reopens the headless browser on the same profile, logins included. The panel offers "Sign in in a window" next to "Take control". Spec 21.11 (new), 21.7, 21.3 and 19.
Edge 153 on the CI lists them as Microsoft Edge, Not_A Brand, Chromium.
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.
Builds on #138 (its commit shows here until that one merges).
Google, and other sites that look past the user agent and
navigator.webdriver, refuse to sign in to the bot's browser ("This browser or app may not be secure"). That happens even with the owner in control, because the browser is still a headless Edge driven over DevTools. This PR adds a way around it that hides nothing from the site: the owner signs in to the bot's profile in a real Edge window.Daemon
browser.window {botId}: it closes the headless browser, then starts the same browser with a window, on the same profile, without--remote-debugging-portand on the page the bot was on (browser/window.rs,launch::window). It runs in its own job, so it dies with the daemon.BrowserState.windowistrue(statusclosed, controlowner), and the bot's tools wait as they do for the owner's hands.browser.listincludes the browser. Pausing the bot does not close the window; archiving it kills the window.browser_ask_ownerrequest is answered Done, and the tool tells the bot tobrowser_openagain because the logins stay.App
FakeBotloftsupports it. Newwindow.test.tsx.Measured with Edge 154 (recorded in spec 19): a
msedge.exestarted with--user-data-dirand no DevTools stays alive as the browser itself and exits a few seconds after its window closes. A cookie set in the window shows up in the headless Edge opened later on the same profile.Spec: new 21.11 (old 21.11 Marcos becomes 21.12, with the N3.4 milestone), plus updates to 21.7 and 21.3.
Checks: cargo fmt, clippy and the full test suite (twice), and
pnpm check. I also checked the panel in the dev preview.lib/fakeBrowser.tsis now 324 lines, a little over the ~300 guideline.Manual test with real Claude Code
browser_ask_owner: closing the window should mark the request Done, and the bot should reopen the page.