Skip to main content

RequestInterceptor

Type Alias RequestInterceptor 

Source
pub type RequestInterceptor = Arc<dyn Fn(InterceptedRequest) -> BoxFuture<'static, InterceptDecision> + Send + Sync>;
Expand description

Caller-supplied hook, consulted for every request the page makes (redirect hops included).

It runs after the session’s crate::NetworkPolicy: a request the policy refuses is failed without the hook seeing it, so a hook can only narrow what the policy allows. A hook that takes longer than 30 s fails the request.

Aliased Type§

pub struct RequestInterceptor { /* private fields */ }