MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / block_urls

Function block_urls

examples/cdp_mode/raw_ad_blocking.py:8–22  ·  view source on GitHub ↗
(tab)

Source from the content-addressed store, hash-verified

6
7
8async def block_urls(tab):
9 await tab.send(mycdp.network.enable())
10 await tab.send(mycdp.network.set_blocked_urls(
11 urls=[
12 "*.googlesyndication.com*",
13 "*.googletagmanager.com*",
14 "*.google-analytics.com*",
15 "*.amazon-adsystem.com*",
16 "*.adsafeprotected.com*",
17 "*.doubleclick.net*",
18 "*.fastclick.net*",
19 "*.snigelweb.com*",
20 "*.2mdn.net*",
21 ]
22 ))
23
24with decorators.print_runtime("raw_ad_blocking.py"):
25 sb = sb_cdp.Chrome()

Callers 1

raw_ad_blocking.pyFile · 0.85

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…