Expand description
Network interception via the Fetch CDP domain.
See the Interception chapter of the zendriver-rs user guide for narrative examples, glob/regex pattern semantics, and streaming-mode recipes.
Two entry points, both built off InterceptBuilder:
- Rule-based — chain
block/redirect/respond/modify_requestand callstart. The returnedInterceptHandletears the actor down on drop. - Stream — call
subscribeto get aStreamofPausedRequest; release each pause by calling one ofcontinue_,abort,respond, ormodify_and_continue.
use zendriver_interception::InterceptBuilder;
let _handle = InterceptBuilder::new(tab)
.block("*/ads/*")?
.redirect("*/old/*", "https://example.com/new/")?
.start();
// _handle stays in scope -> interception live.Re-exports§
pub use actor::InterceptHandle;pub use builder::InterceptBuilder;pub use builder::RequestPattern;pub use error::InterceptionError;pub use paused::PausedRequest;pub use rule::Rule;pub use types::AbortReason;pub use types::RequestInfo;pub use types::RequestOverrides;pub use types::RequestStage;pub use types::ResourceType;pub use types::ResponseInfo;pub use types::ResponseOverrides;
Modules§
- actor
- Background interception actor.
- builder
InterceptBuilder— fluent rule + pattern registration.- error
- Interception-layer errors.
- paused
PausedRequest— the per-event handle handed to stream consumers.- rule
- Declarative interception rules.
- types
- Public types for the Fetch interception API.
- url_
pattern - CDP-style URL pattern matching.