diff --git a/DrissionPage/chromium_driver.py b/DrissionPage/chromium_driver.py index a9dca5d..f1a09a3 100644 --- a/DrissionPage/chromium_driver.py +++ b/DrissionPage/chromium_driver.py @@ -200,7 +200,8 @@ class ChromiumDriver(object): self._started = True self.status = self._STARTED_ self._stopped.clear() - self._ws = create_connection(self._websocket_url, enable_multithread=True) + self._ws = create_connection(self._websocket_url, enable_multithread=True, + suppress_origin=True) self._recv_th.start() self._handle_event_th.start() return True diff --git a/DrissionPage/commons/browser.py b/DrissionPage/commons/browser.py index 368adb9..9a7cbec 100644 --- a/DrissionPage/commons/browser.py +++ b/DrissionPage/commons/browser.py @@ -63,7 +63,6 @@ def get_launch_args(opt): # ----------处理arguments----------- result = set() has_user_path = False - remote_allow = False headless = False for i in opt.arguments: if i.startswith(('--load-extension=', '--remote-debugging-port=')): @@ -72,8 +71,6 @@ def get_launch_args(opt): result.add(f'--user-data-dir={Path(i[16:]).absolute()}') has_user_path = True continue - elif i.startswith('--remote-allow-origins='): - remote_allow = True elif i.startswith('--headless'): headless = True @@ -85,9 +82,6 @@ def get_launch_args(opt): path.mkdir(parents=True, exist_ok=True) result.add(f'--user-data-dir={path}') - if not remote_allow: - result.add('--remote-allow-origins=*') - if not headless and system().lower() == 'linux': from os import popen r = popen('systemctl list-units | grep graphical.target') diff --git a/DrissionPage/configs/configs.ini b/DrissionPage/configs/configs.ini index 9a5ad35..ab4c0a1 100644 --- a/DrissionPage/configs/configs.ini +++ b/DrissionPage/configs/configs.ini @@ -4,7 +4,7 @@ download_path = [chrome_options] debugger_address = 127.0.0.1:9222 binary_location = chrome -arguments = ['--remote-allow-origins=*', '--no-first-run', '--disable-gpu', '--disable-infobars', '--disable-popup-blocking'] +arguments = ['--no-first-run', '--disable-gpu', '--disable-infobars', '--disable-popup-blocking'] extensions = [] experimental_options = {'prefs': {'profile.default_content_settings.popups': 0, 'profile.default_content_setting_values': {'notifications': 2}}} page_load_strategy = normal