@@ -233,9 +233,9 @@ def Driver(
233233 wire (bool): Shortcut / Duplicate of "use_wire".
234234 pls (str): Shortcut / Duplicate of "page_load_strategy".
235235 """
236- from contextlib import suppress
237236 from seleniumbase import config as sb_config
238237 from seleniumbase .config import settings
238+ from seleniumbase .core import browser_launcher
239239 from seleniumbase .fixtures import constants
240240 from seleniumbase .fixtures import shared_utils
241241
@@ -790,94 +790,6 @@ def Driver(
790790 browser_name = browser
791791
792792 # Launch a web browser
793- from seleniumbase .core import browser_launcher
794-
795- # Fix Chrome-130 issues by creating a user-data-dir in advance
796- if (
797- undetectable
798- and (
799- not user_data_dir
800- or not os .path .exists (user_data_dir )
801- or not any (os .scandir (user_data_dir ))
802- )
803- and browser == "chrome"
804- and shared_utils .is_chrome_130_or_newer (binary_location )
805- ):
806- import tempfile
807- import time
808- if not user_data_dir :
809- user_data_dir = (
810- os .path .normpath (tempfile .mkdtemp ())
811- )
812- try :
813- decoy_driver = browser_launcher .get_driver (
814- browser_name = browser_name ,
815- headless = False ,
816- locale_code = locale_code ,
817- use_grid = use_grid ,
818- protocol = protocol ,
819- servername = servername ,
820- port = port ,
821- proxy_string = proxy_string ,
822- proxy_bypass_list = proxy_bypass_list ,
823- proxy_pac_url = proxy_pac_url ,
824- multi_proxy = multi_proxy ,
825- user_agent = user_agent ,
826- cap_file = cap_file ,
827- cap_string = cap_string ,
828- recorder_ext = recorder_ext ,
829- disable_cookies = disable_cookies ,
830- disable_js = disable_js ,
831- disable_csp = disable_csp ,
832- enable_ws = enable_ws ,
833- enable_sync = enable_sync ,
834- use_auto_ext = use_auto_ext ,
835- undetectable = undetectable ,
836- uc_cdp_events = uc_cdp_events ,
837- uc_subprocess = uc_subprocess ,
838- log_cdp_events = log_cdp_events ,
839- no_sandbox = no_sandbox ,
840- disable_gpu = disable_gpu ,
841- headless1 = False ,
842- headless2 = True ,
843- incognito = incognito ,
844- guest_mode = guest_mode ,
845- dark_mode = dark_mode ,
846- devtools = devtools ,
847- remote_debug = remote_debug ,
848- enable_3d_apis = enable_3d_apis ,
849- swiftshader = swiftshader ,
850- ad_block_on = ad_block_on ,
851- host_resolver_rules = host_resolver_rules ,
852- block_images = block_images ,
853- do_not_track = do_not_track ,
854- chromium_arg = "decoy" ,
855- firefox_arg = firefox_arg ,
856- firefox_pref = firefox_pref ,
857- user_data_dir = user_data_dir ,
858- extension_zip = None ,
859- extension_dir = None ,
860- disable_features = disable_features ,
861- binary_location = binary_location ,
862- driver_version = driver_version ,
863- page_load_strategy = page_load_strategy ,
864- use_wire = use_wire ,
865- external_pdf = external_pdf ,
866- test_id = test_id ,
867- mobile_emulator = is_mobile ,
868- device_width = d_width ,
869- device_height = d_height ,
870- device_pixel_ratio = d_p_r ,
871- browser = browser_name ,
872- )
873- time .sleep (0.16 )
874- except Exception :
875- pass
876- finally :
877- with suppress (Exception ):
878- decoy_driver .quit ()
879- time .sleep (0.08 )
880-
881793 driver = browser_launcher .get_driver (
882794 browser_name = browser_name ,
883795 headless = headless ,
0 commit comments