Expand description
Network interception types. Network interception types.
Types for request/response interception callbacks.
§Request Interception
ⓘ
use firefox_webdriver::RequestAction;
let intercept_id = tab.intercept_request(|req| {
if req.url.contains("ads") {
RequestAction::block()
} else {
RequestAction::allow()
}
}).await?;§Response Interception
ⓘ
use firefox_webdriver::BodyAction;
let intercept_id = tab.intercept_response_body(|res| {
if res.url.contains("config.json") {
BodyAction::modify_body(r#"{"modified": true}"#)
} else {
BodyAction::allow()
}
}).await?;Structs§
- Intercepted
Request - Data about an intercepted network request.
- Intercepted
Request Body - Data about an intercepted request body (read-only, cannot be modified).
- Intercepted
Request Headers - Data about intercepted request headers.
- Intercepted
Response - Data about an intercepted network response.
- Intercepted
Response Body - Data about an intercepted response body.
Enums§
- Body
Action - Action to take for intercepted response body.
- Headers
Action - Action to take for intercepted headers.
- Request
Action - Action to take for an intercepted request.
- Request
Body - Request body data.
Type Aliases§
- Response
Action - Action to take for intercepted response headers.