Skip to main content

rightkit_browser/
lib.rs

1//! Shared Chrome DevTools Protocol browser runtime for Right Suite products.
2//!
3//! * [`BrowserSession`] owns one Chrome process and any number of pages. Launch uses Chrome
4//!   for Testing ([`chrome_for_testing_path`]); the system browser only with
5//!   [`LaunchOptions::system_chrome`] or [`LaunchOptions::system_chrome_only`].
6//!   Shutdown and drop close gracefully (CDP
7//!   `Browser.close` / SIGTERM to the process group, bounded waits, SIGKILL last).
8//! * [`ProfileSpec`] selects a temporary, named persistent, or caller-owned directory profile.
9//! * Pointer and keyboard actions use real `Input.dispatch*Event` commands, so
10//!   `event.isTrusted`, `:hover`, focus, and default actions behave as for a user.
11//! * [`NetworkPolicy`] blocks loopback/link-local/private/reserved/`file:` targets
12//!   (redirects, subresources, and every proxied connection included) before they
13//!   reach the network; denials are typed ([`BrowserError::Blocked`]).
14//! * [`AdmissionHook`] then gates every effect before it happens.
15//! * [`BrowserEvent`] reports start/stop/crash/denied with session id, reason, and time.
16//! * [`BrowserPage::observe`] returns refs that are checked for staleness before use.
17mod config;
18mod error;
19mod fixture;
20mod fixture_protocol;
21mod fixture_server;
22mod keys;
23mod page;
24#[cfg(windows)]
25mod pipe_transport;
26mod policy;
27mod proc;
28mod proxy;
29mod sandbox_access;
30mod session;
31
32pub use config::{
33    chrome_for_testing_candidates, chrome_for_testing_path, find_chrome, LaunchOptions,
34    ProfileSpec, CHROME_FOR_TESTING_ENV, CHROME_FOR_TESTING_INSTALL_HINT,
35    CHROME_FOR_TESTING_ROOT_ENV,
36};
37pub use error::{BrowserError, Result};
38pub use fixture::{
39    FixtureAttestation, FixtureCancellation, FixtureCleanupEvidence, FixtureConfinementBackend,
40    FixtureOutcome, FixtureOutcomeStatus, FixtureRunFailure, FixtureSession,
41};
42pub use fixture_protocol::{
43    actions_digest, FixtureAction, FixtureBundle, FixtureError, FixtureFile, FixtureIntent,
44    FixtureKey, FIXTURE_SCHEMA,
45};
46pub use fixture_server::FixtureServer;
47pub use page::{BrowserPage, ConsoleLine, Observation, ObservedNode, Rect, Target};
48pub use policy::{
49    classify_ip, ActionKind, AddressClass, AdmissionHook, AdmissionRequest, AllowCallback,
50    BlockReason, BlockedRequest, BrowserEvent, BrowserRequest, Decision, EventSink, LifecycleKind,
51    NetworkPolicy, NetworkRequest, PolicyDecision, PolicyDenial, Resolver,
52};
53pub use proxy::PinnedConnection;
54pub use session::BrowserSession;