Configure browser behavior and context settings
BrowserConfig
and BrowserContextConfig
. These settings control everything from headless mode to proxy settings and page load behavior.
BrowserConfig
class controls the core browser behavior and connection settings.
False
)
Runs the browser without a visible UI. Note that some websites may detect headless mode.
True
)
Disables browser security features. While this can fix certain functionality issues (like cross-site iFrames), it should be used cautiously, especially when visiting untrusted websites.
[]
)
Additional arguments passed to the browser at launch. See the full list of available arguments.
None
)
Standard Playwright proxy settings for using external proxy services.
BrowserContextConfig()
)
Default settings for new browser contexts. See Context Configuration below.
None
)
WebSocket URL for connecting to external browser providers (e.g., anchorbrowser.com, steel.dev, browserbase.com, browserless.io).headless-shell
or browserless
.
None
)
URL for connecting to a Chrome instance via CDP. Commonly used for debugging or connecting to locally running Chrome instances.None
)
Path to connect to an existing Chrome installation. Particularly useful for workflows requiring existing login states or browser preferences.BrowserContextConfig
class controls settings for individual browser contexts.
0.5
)
Minimum time to wait before capturing page state for LLM input.
1.0
)
Time to wait for network activity to cease. Increase to 3-5s for slower websites. This tracks essential content loading, not dynamic elements like videos.
5.0
)
Maximum time to wait for page load before proceeding.
{'width': 1280, 'height': 1100}
)
Browser window dimensions. The default size is optimized for general use cases and interaction with common UI elements like cookie banners.
None
)
Specify user locale, for example en-GB, de-DE, etc. Locale will affect navigator.language value, Accept-Language request header value as well as number and date formatting rules. If not provided, defaults to the system default locale.
True
)
Highlight interactive elements on the screen with colorfull bounding boxes.
500
)
Viewport expansion in pixels. With this you can controll how much of the page is included in the context of the LLM. If set to -1, all elements from the entire page will be included (this leads to high token usage). If set to 0, only the elements which are visible in the viewport will be included.
Default is 500 pixels, that means that we inlcude a little bit more than the visible viewport inside the context.
None
)
List of allowed domains that the agent can access. If None, all domains are allowed.
Example: [‘google.com’, ‘wikipedia.org’] - Here the agent will only be able to access google and wikipedia.None
)
Directory path for saving video recordings.
None
)
Directory path for saving trace files. Files are automatically named as {trace_path}/{context_id}.zip
.