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 keys;
20mod page;
21mod policy;
22mod proc;
23mod proxy;
24mod session;
25
26pub use config::{
27 chrome_for_testing_candidates, chrome_for_testing_path, find_chrome, LaunchOptions,
28 ProfileSpec, CHROME_FOR_TESTING_ENV, CHROME_FOR_TESTING_INSTALL_HINT,
29 CHROME_FOR_TESTING_ROOT_ENV,
30};
31pub use error::{BrowserError, Result};
32pub use page::{BrowserPage, ConsoleLine, Observation, ObservedNode, Rect, Target};
33pub use policy::{
34 classify_ip, ActionKind, AddressClass, AdmissionHook, AdmissionRequest, AllowCallback,
35 BlockReason, BlockedRequest, BrowserEvent, BrowserRequest, Decision, EventSink, LifecycleKind,
36 NetworkPolicy, NetworkRequest, PolicyDecision, PolicyDenial, Resolver,
37};
38pub use proxy::PinnedConnection;
39pub use session::BrowserSession;