Skip to content

Commit 76a2781

Browse files
committed
Update the browser launcher
1 parent fd4f52a commit 76a2781

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ def _set_chrome_options(
209209
chrome_options.add_argument("--disable-single-click-autofill")
210210
chrome_options.add_argument("--disable-translate")
211211
chrome_options.add_argument("--disable-web-security")
212+
chrome_options.add_argument("--homepage=about:blank")
213+
chrome_options.add_argument("--dom-automation")
212214
if servername == "localhost" or servername == "127.0.0.1":
213215
chrome_options.add_experimental_option("useAutomationExtension", False)
214216
if (settings.DISABLE_CSP_ON_CHROME or disable_csp) and not headless:
@@ -223,6 +225,8 @@ def _set_chrome_options(
223225
chrome_options = _add_chrome_proxy_extension(
224226
chrome_options, proxy_string, proxy_user, proxy_pass)
225227
chrome_options.add_argument('--proxy-server=%s' % proxy_string)
228+
else:
229+
chrome_options.add_argument("--no-proxy-server")
226230
if headless:
227231
if not proxy_auth:
228232
# Headless Chrome doesn't support extensions, which are
@@ -231,10 +235,10 @@ def _set_chrome_options(
231235
# using Chrome's built-in headless mode. See link for details:
232236
# https://bugs.chromium.org/p/chromium/issues/detail?id=706008
233237
chrome_options.add_argument("--headless")
234-
if headless or disable_gpu:
235-
chrome_options.add_argument("--disable-gpu")
236-
if (headless and "linux" in PLATFORM) or no_sandbox:
237-
chrome_options.add_argument("--no-sandbox")
238+
# if headless or disable_gpu:
239+
chrome_options.add_argument("--disable-gpu") # (Now always on)
240+
# if (headless and "linux" in PLATFORM) or no_sandbox:
241+
chrome_options.add_argument("--no-sandbox") # (Now always on)
238242
if "linux" in PLATFORM:
239243
chrome_options.add_argument("--disable-dev-shm-usage")
240244
return chrome_options

0 commit comments

Comments
 (0)