Expand description
Shared Chrome DevTools Protocol browser runtime for Right Suite products.
BrowserSessionowns one Chrome process and any number of pages. Launch uses Chrome for Testing (chrome_for_testing_path); the system browser only withLaunchOptions::system_chromeorLaunchOptions::system_chrome_only. Shutdown and drop close gracefully (CDPBrowser.close/ SIGTERM to the process group, bounded waits, SIGKILL last).ProfileSpecselects a temporary, named persistent, or caller-owned directory profile.- Pointer and keyboard actions use real
Input.dispatch*Eventcommands, soevent.isTrusted,:hover, focus, and default actions behave as for a user. NetworkPolicyblocks loopback/link-local/private/reserved/file:targets (redirects, subresources, and every proxied connection included) before they reach the network; denials are typed (BrowserError::Blocked).AdmissionHookthen gates every effect before it happens.BrowserEventreports start/stop/crash/denied with session id, reason, and time.BrowserPage::set_request_interceptorlets the caller continue, rewrite, fulfil or fail every request after the network policy;BrowserPage::accessibility_tree,BrowserPage::exceptions,BrowserPage::set_page_scaleandBrowserPage::set_download_behaviorexpose the matching CDP domains.- Real-session mode (consent-gated):
default_browser,UserConsentReceipt,ProfileSpec::ImportedFromandBrowserSession::attach_user_browserreuse the user’s own sign-ins in a private copy, confined to the consented domains. SeeImportSpec. cookies::parse_netscapereads a Netscapecookies.txt(bounded; values redacted inDebugand errors) andBrowserPage::import_cookiessets the result in the profile. With featurecookie-export,CookieExportgoes the other way: it keeps the cookies of declared domains and publishes them as a private Netscape file through rightkit-fs; an empty or invalid export never replaces the previous file.- With feature
profile-vault,ProfileVaultandLaunchOptions::encrypted_profilekeep a persistent profile as one authenticated-encrypted file at rest: decrypted to a private working directory for the session, re-sealed and wiped at stop, recovered after a crash, and refused with a typedVaultErrorwhen the credential-store key is unavailable. captureloads one real URL and returns a typedCaptureReport: load result, PNG, metrics, console and (featureaxe) axe-core output, each hashed and bound to the session, process, profile, page, frame, loader and context that produced it, with the terminal cleanup outcome (StopReport) of success, failure, timeout and cancellation alike.BrowserPage::observereturns refs that are checked for staleness before use;BrowserPage::actruns one action on a ref (epoch, document, tag, role and name checked first) and returns the diff, and stops a run that repeats the same no-effect action (BrowserError::ActionLoop).design_modeholds the element-picker primitives: an isolated-world binding bridge, a one-shot native-gesture submit gate, device-pixel capture geometry and the picker script builder.
Re-exports§
pub use cookies::parse_netscape;pub use cookies::CookieFieldError;pub use cookies::CookieParseError;pub use cookies::NetscapeCookie;pub use cookies::MAX_COOKIES;pub use cookies::MAX_COOKIES_FILE_BYTES;
Modules§
- cookies
- Netscape
cookies.txtparsing and the CDP mapping that imports the cookies into the current browser profile (BrowserPage::import_cookies). - design_
mode - Design-mode element-picker primitives: a trusted binding bridge with one-shot submit authentication, device-pixel capture geometry, and the picker script builder.
Structs§
- ActResult
- The result of one
BrowserPage::act. - Admission
Request - One typed request to perform an effect. Typed text is never included, only its length, so admission logs stay content-free.
- AxNode
- One node of
Accessibility.getFullAXTree. - AxSummary
- One non-ignored node of an accessibility tree that has a role, as carried by an observation.
- AxeObservation
- The axe-core result.
- AxeSpec
- An accessibility check to run with the vendored axe-core.
- Blocked
Request - Copy of the old string-only blocked record, kept per page.
- Browser
Event - One structured, content-free lifecycle event for the caller’s journal. Never carries typed text, page content, or full URLs.
- Browser
Page - Browser
Request - One network request about to leave the browser, as seen by the allow callback.
- Browser
Session - One Chrome process with any number of pages.
- Capture
Artifact - One file the capture wrote.
- Capture
Binding - The caller’s own identity for the work being captured, carried verbatim into the report.
Each digest is a non-empty string of at most 200 characters with no control characters; the
format (for example
sha256:<hex>) is the caller’s. - Capture
Cancellation - Sticky, cloneable cancellation signal for
capture. - Capture
Identity - What produced the capture: the browser instance and the exact document observed, bound to the caller’s digests.
- Capture
Report - Everything one capture produced.
- Capture
Request - One capture of one URL.
- Cleanup
Report - Terminal cleanup, as achieved.
- Consent
Revocation - Live revocation switch shared with a running session. Calling
Self::revokemakes the session’s next action fail, without waiting for the app to persist the receipt. - Console
Line - Console
Observation - Console output and uncaught exceptions from page creation to the end of observation.
- Console
Record - Continue
Overrides - Overrides for a continued request. Anything left
Noneis unchanged. - Exception
Frame - One frame of an exception’s stack.
- Fixture
Attestation - Fixture
Bundle - Fixture
Cancellation - Sticky, cloneable cancellation signal for a fixture run.
- Fixture
Cleanup Evidence - Fixture
File - Fixture
Intent - Fixture
Outcome - Fixture
RunFailure - Fixture
Server - An exclusively owned server for one verified, immutable fixture bundle.
- Fixture
Session - Opaque execution authority for one immutable source bundle and one closed action list.
- Import
Report - Result of one import. Per-domain cookie counts need the cookie database opened, which this
module does not do, so
domain_countsisNone. - Import
Spec - Consent-gated copy of a browser profile’s sign-ins into a named RightKit profile (see
crate::ProfileSpec::ImportedFrom). - Intercepted
Request - One
Fetch.requestPausedevent, decoded. - Launch
Options - Load
Observation - The navigation result.
- Managed
Root - The RightKit-managed Chrome for Testing folder and its fixed layout: one
currentinstall, onecurrent.previousrollback copy, andcurrent.stagingwhile an install runs. No per-version folders and no new id: every app resolves the same path. - Metrics
Observation - Navigation and paint timings; values the browser did not report are JSON
null. - Network
Policy - Typed SSRF/host policy. See the module docs for defaults.
- Node
Change - An element that was there before the action and is still there, but looks different.
- Node
State - What an observed element looked like. Names of password-like fields are already masked.
- Observation
- Observation
Diff - What one action changed. Elements are matched by selector; an element with no selector (it cannot be targeted by ref) is not part of the diff.
- Observed
Node - Page
Exception - One
Runtime.exceptionThrownevent: an uncaught exception or unhandled rejection. - Page
Setup - What to install on a page before its first navigation; see
BrowserSession::new_page_with. - Pinned
Connection - One connection the proxy made, with the address it pinned.
- Policy
Denial - Typed network-policy denial returned as
crate::BrowserError::Blocked. - Rect
- Screenshot
Artifact - PNG screenshot of the viewport.
- Screenshot
Clip - A capture region in CSS pixels of the page.
xandyare at least zero;widthandheightare positive. - Screenshot
Options - Screenshot options for
BrowserPage::screenshot_with. The default is the viewport as PNG. - Source
Profile - One profile of a Chromium-family browser.
- Stop
Report - What stopping a session actually achieved, step by step (see
BrowserSession::shutdown_report). - User
Consent Receipt - What the user agreed to: which browser, which profile, which domains. The app persists it
(it is
Serialize/Deserialize), shows it, and revokes it. A revoked or expired receipt refuses every later import, attach and action. - Visible
Exit - How the visible browser exited once the person closed it.
- Visible
Launch - What to open in the visible browser.
Enums§
- Action
Kind - Address
Class - Address class of a destination. Everything except
Publicis blocked by default. - AxeStatus
- Block
Reason - Why the network policy refused a request.
- Browser
Error - Browser
Kind - A concrete browser product.
- Browser
Source - Which browser an import reads from.
- Capture
Status - How the capture ended.
- Decision
- Download
Behavior - What the page does with a download.
- Fixture
Action - Fixture
Confinement Backend - Fixture
Error - Fixture
Key - Fixture
Outcome Status - Intercept
Decision - The answer to one paused request.
- Intercept
Failure - Why a request is failed; maps to the CDP
Network.ErrorReasonthe page sees. - Intercept
Stage - Which stage a paused request is at.
- Lifecycle
Kind - Policy
Decision - Answer of the per-request allow callback.
- Profile
Spec - Where the browser keeps cookies, storage, and logins.
- RefAction
- The one action
BrowserPage::actruns on a ref. - Screenshot
Format - Image format of a screenshot.
- Target
- What an action addresses.
Constants§
- CAPTURE_
SCHEMA - Schema tag of every
CaptureReport. - CHROME_
FOR_ TESTING_ INSTALL_ HINT - How to get Chrome for Testing; part of
BrowserError::ChromeForTestingNotFound. The text names the environment override only in a build with the cargo featurehost-env. - CONSENT_
SCHEMA - Schema version of
UserConsentReceipt. - DEFAULT_
ACTION_ LOOP_ LIMIT - How many times the same action may run on the same ref with no diff before the next one is refused.
- FIXTURE_
SCHEMA - MAX_
CAPTURE_ AXE_ BYTES - Largest axe result kept, in bytes of JSON.
- MAX_
CAPTURE_ CONSOLE_ RECORDS - Most console records kept.
- MAX_
CAPTURE_ DEADLINE - Longest accepted deadline.
- MAX_
CAPTURE_ SCREENSHOT_ BYTES - Largest screenshot accepted, in bytes.
- MAX_
CAPTURE_ VIEWPORT_ EDGE - Largest viewport edge, in CSS pixels.
- MAX_
EXCEPTIONS - Structured exceptions kept per page (oldest dropped first).
- MAX_
EXTRA_ HEADERS - Most extra HTTP headers one
BrowserPage::set_extra_headerscall accepts. - MAX_
HEADER_ VALUE_ BYTES - Longest accepted extra-header value, in bytes.
- MAX_
USER_ AGENT_ BYTES - Longest accepted user-agent string, in bytes.
- OBSERVE_
AX_ DEPTH - Depth bound for the accessibility summary in an
Observation.
Functions§
- actions_
digest - browser_
executable - The installed browser executable for a Chromium-family kind.
- capture
- Capture
request. See the module docs for what is returned on each ending. - chrome_
for_ testing_ candidates - Known Chrome for Testing install locations, in resolution order: the RightKit-managed
current(thencurrent.previous, then legacy per-version folders; the cargo featurehost-envlets the environment override the root), app installs, then Puppeteer’s cache (PUPPETEER_CACHE_DIR), then Playwright’s (PLAYWRIGHT_BROWSERS_PATH), newest version first within each cache. - chrome_
for_ testing_ path - Resolve Chrome for Testing:
explicit, then (only with the cargo featurehost-env) the executable named by the environment, thenchrome_for_testing_candidates. Errors with install instructions; never returns regular Chrome. - classify_
ip - default_
browser - The user’s default web browser on Windows, macOS and Linux, or
BrowserKind::Unknownwhen it cannot be determined. - find_
chrome - System Chrome, Chromium, then Edge.
CHROMEenv overrides. Launch uses this only withLaunchOptions::system_chromeorLaunchOptions::system_chrome_only; preferchrome_for_testing_pathfor isolated automation. - list_
profiles - Profiles of an installed Chromium-family browser, for the consent screen.
- purge_
imported_ profile - Delete an imported RightKit profile (revoking consent should call this). Refuses a directory RightKit did not import into, and a profile a live session holds.
- run_
visible_ until_ exit - Start the browser showing
launch.urland block until its process exits. No remote debugging flag is passed, so the browser exposes no control endpoint. Blocking: call it from a dedicated thread orspawn_blocking. - user_
data_ dir - The browser’s own user-data directory (read only by this module), when it exists.
Type Aliases§
- Admission
Hook - Allow
Callback - Event
Sink - Network
Request - Former name, kept for existing callers.
- Request
Interceptor - Caller-supplied hook, consulted for every request the page makes (redirect hops included).
- Resolver
- Result