Skip to main content

should_block_request

Function should_block_request 

Source
pub fn should_block_request(
    resource_type: &str,
    url: &str,
    disable_resources: bool,
    blocked_domains: &HashSet<String>,
) -> bool
Expand description

Returns true if a request should be blocked based on its resource type or domain.

This is the top-level function called from Playwright’s route handler. It first checks resource-type blocking, then parses the URL and checks domain blocking. If either check matches, the request is blocked.