Repository navigation
Should the server’s agent browser be pluggable? Starting with a remote CDP endpoint #24401
codewarnab
started this conversation in
Ideas
Replies: 1 comment
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Make the server-side agent browser pluggable (remote CDP as a first step)
The problem
The browser the agent controls on the server is currently tied to the bundled
chrome-headless-shell. That works well by default, but it's hard to use in a few setups:The Electron desktop mode already uses
connectOverCDP(endpoint)inServerBrowserContexts.ts, so the server clearly can work against an external browser. It just isn't reachable from headless/server deployments.Smallest step I'd propose
A single env var,
T3CODE_CDP_WS_ENDPOINT. When set, the server:PreviewBrowserdownload/verify/install stepchromium.connectOverCDP(endpoint)instead ofchromium.launch(executable)When unset, behaviour is unchanged, and the Electron path isn't touched. Both pieces already exist, so this is mostly wiring.
Where this could go
If this direction is OK, the same idea could grow into a small "browser provider" notion:
bundled(default)chrome-headless-shellexecutablecdpThat would make the browser configurable and runnable anywhere (a sidecar container, a remote machine, a hosted browser service) without forks.
Questions I'd love input on
Page.startScreencast. Standard--remote-debugging-portChrome supports it, but should we detect and fail clearly when an endpoint doesn't?Alternatives considered
Keeping a local patch on top of
ServerBrowserContexts.ts/PreviewBrowser.tsworks, but it needs a manual rebase on every upstream change to those files.Happy to put up a PR for the env-var step if the direction sounds right.
All reactions