Skip to content

Commit 7be87df

Browse files
committed
Workaround for using a proxy server with auth in Chrome headless mode
1 parent bd0824b commit 7be87df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,13 @@ def get_local_driver(
395395
downloads_path, proxy_string, proxy_auth,
396396
proxy_user, proxy_pass)
397397
if headless:
398-
chrome_options.add_argument("--headless")
398+
# Headless Chrome doesn't support extensions, which are
399+
# required when using a proxy server that has authentication.
400+
# Instead, base_case.py will use PyVirtualDisplay when not
401+
# using Chrome's built-in headless mode. See link for details:
402+
# https://bugs.chromium.org/p/chromium/issues/detail?id=706008
403+
if not proxy_auth:
404+
chrome_options.add_argument("--headless")
399405
chrome_options.add_argument("--disable-gpu")
400406
chrome_options.add_argument("--no-sandbox")
401407
if LOCAL_CHROMEDRIVER and os.path.exists(LOCAL_CHROMEDRIVER):

0 commit comments

Comments
 (0)