Skip to main content

Crate rightkit_browser

Crate rightkit_browser 

Source
Expand description

Shared Chrome DevTools Protocol browser runtime for Right Suite products.

  • BrowserSession owns one Chrome process and any number of pages. Launch uses Chrome for Testing (chrome_for_testing_path); the system browser only with LaunchOptions::system_chrome. Shutdown and drop close gracefully (CDP Browser.close / SIGTERM to the process group, bounded waits, SIGKILL last).
  • ProfileSpec selects a temporary or named persistent profile.
  • Pointer and keyboard actions use real Input.dispatch*Event commands, so event.isTrusted, :hover, focus, and default actions behave as for a user.
  • NetworkPolicy blocks loopback/link-local/private/reserved/file: targets (redirects, subresources, and every proxied connection included) before they reach the network; denials are typed (BrowserError::Blocked).
  • AdmissionHook then gates every effect before it happens.
  • BrowserEvent reports start/stop/crash/denied with session id, reason, and time.
  • BrowserPage::observe returns refs that are checked for staleness before use.

Structs§

AdmissionRequest
One typed request to perform an effect. Typed text is never included, only its length, so admission logs stay content-free.
BlockedRequest
Copy of the old string-only blocked record, kept per page.
BrowserEvent
One structured, content-free lifecycle event for the caller’s journal. Never carries typed text, page content, or full URLs.
BrowserPage
BrowserRequest
One network request about to leave the browser, as seen by the allow callback.
BrowserSession
One Chrome process with any number of pages.
ConsoleLine
LaunchOptions
NetworkPolicy
Typed SSRF/host policy. See the module docs for defaults.
Observation
ObservedNode
PinnedConnection
One connection the proxy made, with the address it pinned.
PolicyDenial
Typed network-policy denial returned as crate::BrowserError::Blocked.
Rect

Enums§

ActionKind
AddressClass
Address class of a destination. Everything except Public is blocked by default.
BlockReason
Why the network policy refused a request.
BrowserError
Decision
LifecycleKind
PolicyDecision
Answer of the per-request allow callback.
ProfileSpec
Where the browser keeps cookies, storage, and logins.
Target
What an action addresses.

Constants§

CHROME_FOR_TESTING_ENV
Environment variable naming an explicit Chrome for Testing executable.
CHROME_FOR_TESTING_INSTALL_HINT
How to get Chrome for Testing; part of BrowserError::ChromeForTestingNotFound.

Functions§

chrome_for_testing_candidates
Known Chrome for Testing install locations, in resolution order: 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 RIGHTKIT_CHROME_FOR_TESTING, then chrome_for_testing_candidates. Errors with install instructions; never returns regular Chrome.
classify_ip
find_chrome
System Chrome, Chromium, then Edge. CHROME env overrides. Launch uses this only with LaunchOptions::system_chrome; prefer chrome_for_testing_path.

Type Aliases§

AdmissionHook
AllowCallback
EventSink
NetworkRequest
Former name, kept for existing callers.
Resolver
Result