fix: companion launches your real Chrome like a normal browser#48
Merged
Conversation
Playwright's launch defaults are tuned for throwaway CI Chromium and degrade the user's real Chrome: chromiumSandbox defaults to false (adds --no-sandbox, which strips the OS sandbox on live browsing and trips Chrome's "unsupported command-line flag … stability and security will suffer" warning), and the default args disable the user's extensions (password managers break), force software WebGL, and turn off sync. Set chromiumSandbox:true and strip the disruptive default args so the window the agent drives is the user's actual Chrome.
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.
Problem
zero browser connectdrives the user's real Chrome via Playwright, but Playwright's launch defaults are tuned for throwaway CI Chromium and degrade a real browser. Captured fromchrome://versionon an actual launch:This is the reproduced cause of the "browser is unstable / uses flags that don't exist (no sandbox)" report:
--no-sandbox— Playwright'schromiumSandboxdefaults tofalse, so it strips the OS sandbox on the user's live browsing and trips Chrome's yellow "You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer." warning.--disable-extensions— kills the user's extensions (password managers / 1Password vanish, logins break).--enable-unsafe-swiftshader— forces software WebGL (janky rendering).--disable-sync— turns off their sync.Fix
Set
chromiumSandbox: trueand strip the disruptive default args viaignoreDefaultArgs, so the window the agent drives behaves like the user's actual Chrome. Verified the launch still connects and is controllable, with--no-sandboxand--disable-extensionsgone.Shipping note
The laptop CLI bundle is served from the server (
/zero-cli.js←zero/dist/cli.js). Redeploy the server with the rebuilt bundle, then re-runcurl …/install.sh | shto pick it up.