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`]. Shutdown and drop close gracefully (CDP
6//! `Browser.close` / SIGTERM to the process group, bounded waits, SIGKILL last).
7//! * [`ProfileSpec`] selects a temporary or named persistent profile.
8//! * Pointer and keyboard actions use real `Input.dispatch*Event` commands, so
9//! `event.isTrusted`, `:hover`, focus, and default actions behave as for a user.
10//! * [`NetworkPolicy`] blocks loopback/link-local/private/reserved/`file:` targets
11//! (redirects, subresources, and every proxied connection included) before they
12//! reach the network; denials are typed ([`BrowserError::Blocked`]).
13//! * [`AdmissionHook`] then gates every effect before it happens.
14//! * [`BrowserEvent`] reports start/stop/crash/denied with session id, reason, and time.
15//! * [`BrowserPage::observe`] returns refs that are checked for staleness before use.
16mod config;
17mod error;
18mod keys;
19mod page;
20mod policy;
21mod proc;
22mod proxy;
23mod session;
24
25pub use config::{
26 chrome_for_testing_candidates, chrome_for_testing_path, find_chrome, LaunchOptions,
27 ProfileSpec, CHROME_FOR_TESTING_ENV, CHROME_FOR_TESTING_INSTALL_HINT,
28};
29pub use error::{BrowserError, Result};
30pub use page::{BrowserPage, ConsoleLine, Observation, ObservedNode, Rect, Target};
31pub use policy::{
32 classify_ip, ActionKind, AddressClass, AdmissionHook, AdmissionRequest, AllowCallback,
33 BlockReason, BlockedRequest, BrowserEvent, BrowserRequest, Decision, EventSink, LifecycleKind,
34 NetworkPolicy, NetworkRequest, PolicyDecision, PolicyDenial, Resolver,
35};
36pub use proxy::PinnedConnection;
37pub use session::BrowserSession;