Repository navigation
Conversation
`open` and `tab new` already pass `background: true` to Target.createTarget, but the two paths that create a tab implicitly -- the site-adapter fallback and `eval --domain` resolution -- did not. On a real desktop Chrome that means an adapter run yanks the tab the user is looking at, which is exactly what an agent driving the user's own browser must not do. Pass `background: true` in both places. Verified on Chrome 157 with a visibility probe: with background:true the new page reports visibilityState=hidden and keeps the user's visible tab focused, while eval / DOM / images / lazy loading still work. Request animation frames are paused in background tabs, so pages that depend on rAF to render need a separate unfocused window (newWindow:true + background:true) rather than a foreground switch. Typecheck: 8 pre-existing errors before and after this change, none added.
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.
openandtab newalready passbackground: truetoTarget.createTarget, but the two paths that create a tab implicitly did not:packages/daemon/src/site-adapter.ts— adapter fallback when no tab matches the site domainpackages/daemon/src/command-dispatch.ts—eval --domainresolution fallbackOn a real desktop Chrome those calls switch the tab the user is looking at. An agent driving the user's own browser should not steal focus just to collect data.
Change
Pass
background: truein both places.Verification (Chrome 157, real user profile, visibility probe before/after)
Target.createTarget {url}Target.createTarget {url, background:true}Target.createTarget {url, newWindow:true, background:true}eval, DOM reads, images and lazy loading still work in a background tab; only rAF-driven rendering is paused. Pages that need foreground rendering semantics should be opened withnewWindow: true, background: trueinstead of being switched to the foreground.Tests
pnpm test: daemon 106 passed / 0 failed (13 skipped — no Chrome on port 19222), cli 24 passed / 0 failed.tsc --noEmitforpackages/daemon: 8 pre-existing errors both before and after this change; none added.