abstractRemoteBrowserProvider <TContext>
Index
Constructors
constructor
Returns RemoteBrowserProvider<TContext>
Properties
optionalmaxOpenBrowsers
Maximum number of browsers that can be open at the same time. Set this to your remote service's concurrent session limit to avoid 429 errors.
Methods
abstractconnect
Called once per browser launch. Return the WebSocket/CDP endpoint URL and an optional
contextobject that will be passed back to release.Parameters
optionaloptions: { proxyUrl?: string }
optionalproxyUrl: string
The proxy URL resolved by Crawlee's proxy configuration for this browser session. Pass it to your remote service's proxy API if supported.
Returns Promise<{ context?: TContext; url: string }> | { context?: TContext; url: string }
release
Called when the browser closes, crashes, the pool is destroyed, or the connection fails right after connect succeeds. Override this to clean up remote sessions, release API resources, etc.
Errors thrown here are caught and logged as warnings — they never crash the crawler. Safe to assume this is called at most once per connect call.
Parameters
_context: TContext
The same
contextobject returned by connect.
Returns Promise<void>
Abstract base class for remote browser service providers.
Implement this class to encapsulate the lifecycle of a remote browser session (creation, connection URL resolution, and cleanup). RemoteBrowserPool calls connect once per browser launch and release when the browser closes, crashes, the pool is destroyed, or the connection fails during launch.
Pass the provider instance as the
endpointof a RemoteBrowserPool, then hand the pool to a crawler via itsbrowserPooloption:Example — simple static endpoint (e.g. Browserless):
Example — session lifecycle with concurrency limit (e.g. Browserbase):