Skip to main content

Module browser

Module browser 

Source
Expand description

Browser management for browser automation.

This module provides utilities for:

  • Launching browser instances
  • Navigation operations

Re-exports§

pub use browser_process::BrowserProcess;
pub use cdp_endpoint::fetch_cdp_version;
pub use cdp_endpoint::read_dev_tools_active_port;
pub use cdp_endpoint::wait_for_cdp_endpoint;
pub use cdp_endpoint::CdpEndpointRequest;
pub use chromiumoxide_adapter::ChromiumoxidePage;
pub use connector::connect_browser;
pub use connector::ConnectOptions;
pub use debugging_port::assert_fixed_debugging_port;
pub use debugging_port::reserve_loopback_port;
pub use debugging_port::PortRaceError;
pub use launcher::launch_browser;
pub use launcher::Browser;
pub use launcher::LaunchMode;
pub use launcher::LaunchOptions;
pub use launcher::LaunchResult;
pub use launcher::LAUNCH_MODES;
pub use media::emulate_media;
pub use media::ColorScheme;
pub use media::EmulateMediaOptions;
pub use navigation_ops::goto;
pub use navigation_ops::verify_navigation;
pub use navigation_ops::wait_for_navigation;
pub use navigation_ops::wait_for_url_stabilization;
pub use navigation_ops::NavigationOptions;
pub use navigation_ops::NavigationResult;
pub use navigation_ops::NavigationVerificationResult;
pub use navigation_ops::WaitUntil;
pub use node_bridge::NodeBridgePage;
pub use open_in_user_browser::build_open_command;
pub use open_in_user_browser::open_in_user_browser;
pub use open_in_user_browser::validate_open_url;
pub use open_in_user_browser::OpenInUserBrowserResult;
pub use playwright_driver_page::PlaywrightConnect;
pub use playwright_driver_page::PlaywrightDriverPage;
pub use playwright_driver_page::PlaywrightLaunch;
pub use profile_directory::create_temporary_user_data_dir;
pub use profile_directory::prepare_user_data_dir;
pub use profile_directory::remove_user_data_dir;
pub use raw_cdp::RawCdpCommand;
pub use real_browser::build_real_browser_args;
pub use real_browser::launch_and_connect_real_browser;
pub use real_browser::launch_real_browser;
pub use real_browser::resolve_system_browser_executable;
pub use real_browser::RealBrowserLaunchResult;
pub use real_browser::RealBrowserOptions;
pub use real_browser::DEFAULT_CLOSE_TIMEOUT;
pub use real_browser::DEFAULT_PORT_ATTEMPTS;
pub use restrictions::launch_restriction_preset;
pub use restrictions::launch_restriction_presets;
pub use restrictions::launch_restrictions;
pub use restrictions::merge_feature_switches;
pub use restrictions::resolve_restrictions;
pub use restrictions::LaunchRestriction;
pub use restrictions::ResolvedRestrictions;
pub use restrictions::LAUNCH_RESTRICTIONS_SOURCE;
pub use snapshot::launch_snapshot;
pub use snapshot::snapshot_user_data_dir;
pub use snapshot::SnapshotLaunchResult;
pub use snapshot::SnapshotOptions;
pub use snapshot::SnapshotReport;
pub use storage_state::save_storage_state;
pub use storage_state::StorageEntry;
pub use storage_state::StorageOrigin;
pub use storage_state::StorageState;
pub use storage_state::StorageStateInput;
pub use system_browser::assert_dedicated_user_data_dir;
pub use system_browser::default_real_browser_user_data_dir;
pub use system_browser::known_default_user_data_dirs;
pub use system_browser::resolve_browser_executable;

Modules§

browser_process
The spawned browser process handle shared by the real-browser launcher and LaunchResult.
cdp_endpoint
Waiting for a spawned browser’s DevTools endpoint and proving it is ours (issue #101).
chromiumoxide_adapter
Chromiumoxide-backed EngineAdapter implementation.
connector
Connect to an already-running Chromium-family browser over CDP.
debugging_port
Fixed remote debugging ports for the real browser (issue #101).
extension_relay
Native typed relay for the shared Chrome companion extension, without Node.
launcher
Browser launcher for browser automation.
media
Media emulation for browser automation.
migration
Profile migration, mirroring js/src/browser/migration/index.js.
navigation_ops
Navigation operations for browser automation.
node_bridge
Node.js CLI bridge for Playwright and Puppeteer engines.
open_in_user_browser
Open a URL with the operating system’s default browser, without automation.
parity
Measure driven browsers against the same binary started by hand.
playwright_driver_page
Native Playwright engine: typed calls to the official driver.
profile_directory
Fresh user data directories for every launch (issues #101 and #103).
raw_cdp
Sending a CDP command chromiumoxide has no generated type for.
real_browser
Launch genuine installed Chrome-family browsers and attach over CDP.
restrictions
Named, opt-in launch restrictions (issue #103).
snapshot
Read-only copies of live Chromium profiles and native snapshot launches.
storage_state
Playwright-compatible cookie and origin-scoped localStorage state.
system_browser
Discovery of installed Chrome-family browsers and their default profiles.
webdriver
Managed ChromeDriver/geckodriver through command-stream, with typed Fantoccini sessions, portable managed downloads and optional native WebDriver BiDi.

Structs§

BrowserCookie
A browser cookie in the shape accepted by Playwright/Puppeteer contexts.
BrowserCookieReadOptions
Options for read_browser_cookies.
BrowserProfile
Metadata for a cookie-bearing installed browser profile.
BrowserProfileOptions
Options for list_browser_profiles.
BrowserSource
One browser in the shared catalogue.
CookieSourceListing
One installed browser profile that holds cookies, with per-domain counts when a domain filter is supplied. Cookie values are never read, so this is the data behind the cookies sources command.
ImportSource
The browser an import reads from, as chosen by resolve_import_source.
SafeStorageIdentity
The Chromium Safe Storage identity for a browser.

Statics§

SUPPORTED_COOKIE_BROWSERS
Browsers whose on-disk cookie stores can be imported, driven by the shared catalogue. Re-exported here so the name callers already use keeps working. Browsers whose on-disk cookie stores can be imported, driven by the shared catalogue. Re-exported here so the name callers already use keeps working. Browsers whose on-disk cookie stores can be imported, driven by the shared catalogue. Re-exported here so the name callers already use keeps working. Browsers whose on-disk cookie stores can be imported, in catalogue order. Mirrors SUPPORTED_COOKIE_BROWSERS/BROWSER_IDS in the JavaScript library.

Functions§

browser_family
The family (chromium or firefox) of a browser name.
browser_for_identifier
Match a raw OS identifier (bundle id, .desktop name or ProgId) to a canonical browser id. Comparison is case-insensitive because the registry and the operating systems disagree on casing.
browser_ids
Canonical browser ids, in catalogue order.
browser_sources
Every known browser, in catalogue order.
clear_browser_cookie_memory_cache
Clear only the current process’s derived-key cache.
default_browser_identifiers
The operating-system identifiers that mark a browser as the system default: macOS bundle ids, Linux .desktop file names, or Windows ProgIds.
default_run_command
The default RunCommand, backed by a real (shell-free) subprocess.
find_browser_source
Resolve a name (canonical id or alias) to its catalogue entry.
is_default_browser_keyword
Whether browser asks for the system default rather than a named browser.
is_single_profile_browser
True when a browser stores one profile in the root itself (Opera-style).
list_browser_profiles
Discover cookie-bearing profiles from installed browsers. When browser is unset, every browser in the shared catalogue is scanned.
list_cookie_sources
List the installed browser profiles that hold cookies, with per-domain counts when domains is given. Values are never read or returned — this is the data behind the cookies sources command.
normalize_browser_id
Resolve a name to its canonical id, erroring with the catalogue listed.
parse_mac_launch_services_handler
Read the https handler bundle id out of defaults read ... LSHandlers output. The output is NeXTSTEP-style plist text; each handler is a brace block that may carry an LSHandlerURLScheme and an LSHandlerRoleAll.
parse_windows_prog_id
Read the ProgId out of reg query ... /v ProgId output: reg prints ProgId REG_SZ FirefoxHTML, so take the last whitespace token of the ProgId line.
read_browser_cookies
Read cookies from an installed Chrome, Edge, Brave, Chromium, or Firefox profile.
resolve_browser_roots
The absolute profile roots a browser uses on a platform. Returns an empty vector when the browser does not run on that platform (for example Chrome Canary on Linux). Windows roots are built with backslashes regardless of the host, so the catalogue resolves identically on any platform.
resolve_default_browser
Resolve the system default browser to a canonical catalogue id, or None when it cannot be determined. On macOS a failure of the lookup tool propagates as an error (there is no fallback); on Linux and Windows a missing tool resolves to None.
resolve_import_source
Pick the source browser for an import.
resolve_source_browser
Resolve a requested browser to a canonical catalogue id, expanding the default/auto keywords to the operating-system default browser. Named browsers are normalized through the catalogue as before.
safe_storage_identity
The Chromium Safe Storage identity for a browser, or None for a Firefox-family browser (which does not use OSCrypt).

Type Aliases§

Environment
Extra environment variables, used when expanding profile-root templates.
RunCommand
A command runner: (command, args, environment) -> stdout. A spawn failure (for example a missing binary) is an Err; any exit code, even non-zero, is an Ok with the captured stdout. Injected so the resolver is deterministic in tests.