Skip to content

Commit 63306d8

Browse files
committed
When setting headless mode, don't use options.headless
1 parent 2c668ed commit 63306d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,6 @@ def get_local_driver(
23422342
device_height,
23432343
device_pixel_ratio,
23442344
)
2345-
opera_options.headless = False # No support for headless Opera
23462345
warnings.simplefilter("ignore", category=DeprecationWarning)
23472346
return webdriver.Opera(options=opera_options)
23482347
except Exception:
@@ -2626,7 +2625,6 @@ def get_local_driver(
26262625
from urllib.error import URLError
26272626

26282627
if "linux" in PLATFORM:
2629-
chrome_options.headless = False # Use Xvfb
26302628
if "--headless" in (
26312629
chrome_options.arguments
26322630
):
@@ -2919,7 +2917,8 @@ def get_local_driver(
29192917
" headless mode. Attempting to use the"
29202918
" SeleniumBase virtual display on Linux..."
29212919
)
2922-
chrome_options.headless = False
2920+
if "--headless" in chrome_options.arguments:
2921+
chrome_options.arguments.remove("--headless")
29232922
return webdriver.Chrome(options=chrome_options)
29242923
except Exception:
29252924
try:

0 commit comments

Comments
 (0)