1pub const EXTRA_RESOURCES: &[&str] = &[
26 "font",
27 "image",
28 "media",
29 "beacon",
30 "object",
31 "imageset",
32 "texttrack",
33 "websocket",
34 "csp_report",
35 "stylesheet",
36];
37
38pub const HARMFUL_ARGS: &[&str] = &[
44 "--enable-automation",
45 "--disable-popup-blocking",
46 "--disable-component-update",
47 "--disable-default-apps",
48 "--disable-extensions",
49];
50
51pub const DEFAULT_ARGS: &[&str] = &[
57 "--no-pings",
58 "--no-first-run",
59 "--disable-infobars",
60 "--disable-breakpad",
61 "--no-service-autorun",
62 "--homepage=about:blank",
63 "--password-store=basic",
64 "--disable-hang-monitor",
65 "--no-default-browser-check",
66 "--disable-session-crashed-bubble",
67 "--disable-search-engine-choice-screen",
68];
69
70pub const STEALTH_ARGS: &[&str] = &[
77 "--test-type",
78 "--lang=en-US",
79 "--mute-audio",
80 "--disable-sync",
81 "--hide-scrollbars",
82 "--disable-logging",
83 "--start-maximized",
84 "--enable-async-dns",
85 "--accept-lang=en-US",
86 "--use-mock-keychain",
87 "--disable-translate",
88 "--disable-voice-input",
89 "--window-position=0,0",
90 "--disable-wake-on-wifi",
91 "--ignore-gpu-blocklist",
92 "--enable-tcp-fast-open",
93 "--enable-web-bluetooth",
94 "--disable-cloud-import",
95 "--disable-print-preview",
96 "--disable-dev-shm-usage",
97 "--metrics-recording-only",
98 "--disable-crash-reporter",
99 "--disable-partial-raster",
100 "--disable-gesture-typing",
101 "--disable-checker-imaging",
102 "--disable-prompt-on-repost",
103 "--force-color-profile=srgb",
104 "--font-render-hinting=none",
105 "--aggressive-cache-discard",
106 "--disable-cookie-encryption",
107 "--disable-domain-reliability",
108 "--disable-threaded-animation",
109 "--disable-threaded-scrolling",
110 "--enable-simple-cache-backend",
111 "--disable-background-networking",
112 "--enable-surface-synchronization",
113 "--disable-image-animation-resync",
114 "--disable-renderer-backgrounding",
115 "--disable-ipc-flooding-protection",
116 "--prerender-from-omnibox=disabled",
117 "--safebrowsing-disable-auto-update",
118 "--disable-offer-upload-credit-cards",
119 "--disable-background-timer-throttling",
120 "--disable-new-content-rendering-timeout",
121 "--run-all-compositor-stages-before-draw",
122 "--disable-client-side-phishing-detection",
123 "--disable-backgrounding-occluded-windows",
124 "--disable-layer-tree-host-memory-pressure",
125 "--autoplay-policy=user-gesture-required",
126 "--disable-offer-store-unmasked-wallet-cards",
127 "--disable-blink-features=AutomationControlled",
128 "--disable-component-extensions-with-background-pages",
129 "--enable-features=NetworkService,NetworkServiceInProcess,TrustTokens,TrustTokensAlwaysAllowIssuance",
130 "--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4",
131 "--disable-features=AudioServiceOutOfProcess,TranslateUI,BlinkGenPropertyTrees",
132];
133
134pub fn build_args(stealth: bool) -> Vec<String> {
140 let mut args: Vec<String> = DEFAULT_ARGS.iter().map(|s| s.to_string()).collect();
141 if stealth {
142 args.extend(STEALTH_ARGS.iter().map(|s| s.to_string()));
143 }
144 args
145}
146
147pub fn filter_harmful_args(args: &[String]) -> Vec<String> {
153 args.iter()
154 .filter(|a| !HARMFUL_ARGS.iter().any(|h| a.starts_with(h)))
155 .cloned()
156 .collect()
157}