You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""(Network.setBlockedURLs) Blocks URLs from loading. [EXPERIMENTAL].
998
+
:param urls: URL patterns to block. Wildcards ('*') are allowed.
999
+
:type urls: List[str]
1000
+
1001
+
Demo::
1002
+
1003
+
await tab.setBlockedURLs(urls=['*.jpg', '*.png'])
1004
+
1005
+
WARNING: This method is EXPERIMENTAL, the official suggestion is using Fetch.enable, even Fetch is also EXPERIMENTAL, and wait events to control the requests (continue / abort / modify), especially block urls with resourceType: Document, Stylesheet, Image, Media, Font, Script, TextTrack, XHR, Fetch, EventSource, WebSocket, Manifest, SignedExchange, Ping, CSPViolationReport, Other.
Copy file name to clipboardExpand all lines: ichrome/daemon.py
+15-12Lines changed: 15 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,12 @@ class ChromeDaemon(object):
30
30
host="127.0.0.1", --remote-debugging-address, default to 127.0.0.1
31
31
port, --remote-debugging-port, default to 9222
32
32
headless, --headless and --hide-scrollbars, default to False
33
-
user_agent, --user-agent, default to 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36'
33
+
user_agent, --user-agent, default to None (with the original UA)
34
34
proxy, --proxy-server, default to None
35
-
user_data_dir, user_data_dir to save the user data, default to ~/ichrome_user_data. These string will ignore user_data_dir arg: {'null', 'None', '/dev/null', "''", '""'}
35
+
user_data_dir, user_data_dir to save the user data, default to ~/ichrome_user_data. These strings will ignore user_data_dir arg: {'null', 'None', '/dev/null', "''", '""'}
36
36
disable_image, disable image for loading performance, default to False
37
-
start_url, start url while launching chrome, default to about:blank
38
-
max_deaths, max deaths in 5 secs, auto restart `max_deaths` times if crash fast in 5 secs. default to 1 for without auto-restart
37
+
start_url, start url while launching chrome, default to None
38
+
max_deaths, max deaths in 5 secs, auto restart `max_deaths` times if crash fast in 5 secs. default to 1 (without auto-restart)
39
39
timeout, timeout to connect the remote server, default to 1 for localhost
40
40
debug, set logger level to DEBUG
41
41
proc_check_interval, check chrome process alive every interval seconds
@@ -67,7 +67,7 @@ class ChromeDaemon(object):
67
67
"""
68
68
69
69
port_in_using: set=set()
70
-
PC_UA="Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36"
70
+
PC_UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36"
71
71
MAC_OS_UA= (
72
72
"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_0_1) Version/8.0.1a Safari/728.28.19"
0 commit comments