Skip to content

Commit f0b5fea

Browse files
committed
Make headless Chrome more reliable in Docker environments
1 parent 3e698b6 commit f0b5fea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ def _set_chrome_options(
106106
}
107107
}
108108
chrome_options.add_experimental_option("prefs", prefs)
109+
if headless:
110+
chrome_options.add_experimental_option("w3c", False)
109111
chrome_options.add_argument("--test-type")
110112
chrome_options.add_argument("--log-level=3")
111113
chrome_options.add_argument("--no-first-run")
@@ -139,6 +141,8 @@ def _set_chrome_options(
139141
chrome_options.add_argument("--headless")
140142
chrome_options.add_argument("--disable-gpu")
141143
chrome_options.add_argument("--no-sandbox")
144+
chrome_options.add_argument("--disable-setuid-sandbox")
145+
chrome_options.add_argument("--disable-dev-shm-usage")
142146
return chrome_options
143147

144148

0 commit comments

Comments
 (0)