mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-07 03:55:24 +00:00
Support running Chrome 119 from source (#960)
This commit is contained in:
parent
5085ca6990
commit
04858c22fd
@ -464,11 +464,9 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
||||
)
|
||||
self.browser_pid = browser.pid
|
||||
|
||||
# Fix for Chrome 115
|
||||
# https://github.com/seleniumbase/SeleniumBase/pull/1967
|
||||
|
||||
service = selenium.webdriver.chromium.service.ChromiumService(
|
||||
executable_path=self.patcher.executable_path,
|
||||
service_args=["--disable-build-check"]
|
||||
self.patcher.executable_path
|
||||
)
|
||||
|
||||
super(Chrome, self).__init__(
|
||||
|
@ -62,7 +62,17 @@ class Patcher(object):
|
||||
prefix = "undetected"
|
||||
self.user_multi_procs = user_multi_procs
|
||||
|
||||
self.is_old_chromedriver = version_main and version_main <= 114
|
||||
try:
|
||||
# Try to convert version_main into an integer
|
||||
version_main_int = int(version_main)
|
||||
# check if version_main_int is less than or equal to e.g 114
|
||||
self.is_old_chromedriver = version_main and version_main_int <= 114
|
||||
except ValueError:
|
||||
# If the conversion fails, print an error message
|
||||
print("version_main cannot be converted to an integer")
|
||||
# Set self.is_old_chromedriver to False if the conversion fails
|
||||
self.is_old_chromedriver = False
|
||||
|
||||
# Needs to be called before self.exe_name is accessed
|
||||
self._set_platform_name()
|
||||
|
||||
|
@ -166,10 +166,6 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
|
||||
driver_exe_path = "/app/chromedriver"
|
||||
else:
|
||||
version_main = get_chrome_major_version()
|
||||
# Fix for Chrome 115
|
||||
# https://github.com/seleniumbase/SeleniumBase/pull/1967
|
||||
if int(version_main) > 114:
|
||||
version_main = 114
|
||||
if PATCHED_DRIVER_PATH is not None:
|
||||
driver_exe_path = PATCHED_DRIVER_PATH
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user