ProtectedfeaturesThe capability flags for the backend this driver instance serves. Populated from the
RemoteBrowserProviderContext at BaseRemoteBrowserProvider.Connect time (call
this.applyContext(ctx) first). Drives BaseRemoteBrowserProvider.RequireFeature.
ProtectedproviderThe backend's display name for this driver instance, used in capability-error messages. Populated from the RemoteBrowserProviderContext; falls back to the driver class name.
The backend's supported-feature flags for this driver instance.
Read-only accessor over the internally-held BaseRemoteBrowserProvider.features. The engine consults this (and the underlying provider metadata) to decide which capability-gated session methods are safe to call; a driver consults it via BaseRemoteBrowserProvider.RequireFeature.
ProtectedAcquireAcquires a CDP endpoint by leasing a headless-Chrome container through the bound runner, then wraps the container handle in a SelfHostSessionBackend. The shared base attaches its adapter to the returned endpoint and delegates the backend-specific concerns (live view / native-AI / release) to the backend.
The provider context (features, configuration, control mode, context user).
A promise resolving to the acquired CDP endpoint + Self-Hosted Chrome backend hooks.
ProtectedapplyCaptures the connection context onto the instance so BaseRemoteBrowserProvider.Features, BaseRemoteBrowserProvider.RequireFeature, and capability-error messages have the backend's flags and name. A concrete BaseRemoteBrowserProvider.Connect should call this first.
The provider context handed to Connect.
ProtectedbuildBuilds the BrowserConfig used to attach the shared adapter to the acquired CDP endpoint.
Always attaches via CDP (ConnectType: 'cdp') — a raw CDP websocket would otherwise be
misclassified as a Playwright server by scheme auto-detection. Viewport hints come from the
context configuration when supplied.
The CDP endpoint to attach to.
The provider context, whose Configuration may carry viewport hints.
The browser config for PlaywrightBrowserAdapter.Launch.
Opens a session: captures the context, has the driver acquire a CDP endpoint, attaches a shared PlaywrightBrowserAdapter to it over CDP, and returns the shared CdpRemoteBrowserSession. The adapter + backend are retained for Disconnect.
The host services and connection parameters for this session.
A promise resolving to the live remote-browser session handle.
ProtectedcreateCreates the PlaywrightBrowserAdapter the session will drive. A dedicated factory seam so tests can substitute a fake adapter without a real browser, and so a specialized driver could supply a pre-configured adapter if ever needed. Production drivers use the default.
A fresh, un-launched PlaywrightBrowserAdapter.
Releases the driver's own backend resources for the live session: closes the attached adapter and releases the backend. Both steps are best-effort and independent so teardown always completes; the retained references are cleared regardless of outcome. Idempotent — safe to call when nothing is connected.
A promise that resolves once teardown has run.
ProtectednotBuilds the standard RemoteBrowserCapabilityNotSupportedError for an un-overridden capability or a failed feature requirement, stamped with this driver's backend name.
The feature / method name to report.
The error to throw or reject with.
ProtectedRequireDefense-in-depth guard: asserts a SupportedFeatures flag is enabled before the driver performs
a capability-gated action, throwing RemoteBrowserCapabilityNotSupportedError if it is
false/omitted. A driver should call this at the top of any capability-gated work so that even a
direct (engine-bypassing) caller cannot run an action the metadata says is off.
The IRemoteBrowserProviderFeatures flag to require.
StaticSetOverrides the ChromeContainerRunnerFactory every SelfHostRemoteBrowser instance uses to acquire its Chrome container — the override seam, mirroring how bridge drivers bind their real SDK. The default is a local-Chromium runner, so this is only needed to point self-host at a real container backend; tests call it with a factory that returns a fake runner.
The factory that constructs the Chrome-container runner.
The Self-Hosted Chrome Remote Browser driver. Subclasses BaseCdpRemoteBrowserProvider and implements only AcquireSession; all connect/disconnect orchestration, action mapping, and capability gating are inherited.
Construct via the default constructor (the engine's
ClassFactorypath). By default it uses a LocalChromeContainerRunner (local headless Chromium) so it works with no external service. The container-runner seam is bound process-wide via the static SetContainerRunnerFactory — mirroring how bridge drivers bind their real SDK — so a deployment that wants a real container backend overrides the default once at startup and every resolved driver instance shares it.Registered via
@RegisterClass(BaseRemoteBrowserProvider, 'SelfHostRemoteBrowser').