Skip to main content

chromiumoxide/handler/blockers/
mod.rs

1/// Block websites from spider_firewall list
2pub mod block_websites;
3/// xhr blockers
4pub mod xhr;
5
6pub use spider_network_blocker::intercept_manager::NetworkInterceptManager;
7
8/// Url matches analytics that we want to ignore or trackers.
9#[inline]
10pub(crate) fn ignore_script_embedded(url: &str) -> bool {
11    spider_network_blocker::scripts::URL_IGNORE_EMBEDED_TRIE.contains_prefix(url)
12}
13
14/// Url matches analytics that we want to ignore or trackers.
15#[inline]
16pub(crate) fn ignore_script_xhr(url: &str) -> bool {
17    spider_network_blocker::xhr::URL_IGNORE_XHR_TRIE.contains_prefix(url)
18}
19
20/// Url matches media that we want to ignore.
21#[inline]
22pub(crate) fn ignore_script_xhr_media(url: &str) -> bool {
23    spider_network_blocker::xhr::URL_IGNORE_XHR_MEDIA_TRIE.contains_prefix(url)
24}