Skip to content

Commit 8ad5242

Browse files
authored
Merge pull request #4050 from seleniumbase/linux-chromium-search-updates
Linux Chromium search updates
2 parents e6b686d + d174cd4 commit 8ad5242

File tree

4 files changed

+51
-15
lines changed

4 files changed

+51
-15
lines changed

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.44.0"
2+
__version__ = "4.44.1"

seleniumbase/core/browser_launcher.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,15 +2618,20 @@ def _set_chrome_options(
26182618
if is_using_uc(undetectable, browser_name):
26192619
chrome_options.add_argument("--disable-application-cache")
26202620
chrome_options.add_argument("--disable-setuid-sandbox")
2621-
if not binary_location:
2621+
if not binary_location:
2622+
if os.path.exists("/bin/google-chrome"):
2623+
binary_location = "/bin/google-chrome"
2624+
elif os.path.exists("/usr/bin/google-chrome-stable"):
2625+
binary_location = "/usr/bin/google-chrome-stable"
2626+
elif os.path.exists("/usr/bin/google-chrome"):
2627+
binary_location = "/usr/bin/google-chrome"
2628+
elif os.path.exists("/usr/bin/google-chrome-stable"):
2629+
binary_location = "/usr/bin/google-chrome-stable"
2630+
else:
26222631
br_app = "google-chrome"
26232632
binary_loc = detect_b_ver.get_binary_location(br_app, True)
26242633
if os.path.exists(binary_loc):
26252634
binary_location = binary_loc
2626-
elif os.path.exists("/usr/bin/google-chrome-stable"):
2627-
binary_location = "/usr/bin/google-chrome-stable"
2628-
elif os.path.exists("/usr/bin/google-chrome"):
2629-
binary_location = "/usr/bin/google-chrome"
26302635
extra_disabled_features = []
26312636
if chromium_arg:
26322637
# Can be a comma-separated list of Chromium args or a list

seleniumbase/core/detect_b_ver.py

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,22 @@ def chrome_on_linux_path(chromium_ok=False, browser_type=None):
105105
return ""
106106
if os_name() != OSType.LINUX:
107107
return ""
108-
paths = ["/bin/google-chrome", "/bin/google-chrome-stable"]
108+
paths = [
109+
"/bin/google-chrome",
110+
"/bin/google-chrome-stable",
111+
"/usr/bin/google-chrome",
112+
"/usr/bin/google-chrome-stable"
113+
]
109114
for path in paths:
110-
if os.path.exists(path) and os.access(path, os.X_OK):
111-
return path
115+
try:
116+
if (
117+
os.path.exists(path)
118+
and os.access(path, os.R_OK)
119+
and os.access(path, os.X_OK)
120+
):
121+
return path
122+
except Exception:
123+
pass
112124
paths = os.environ["PATH"].split(os.pathsep)
113125
binaries = []
114126
binaries.append("google-chrome")
@@ -122,13 +134,32 @@ def chrome_on_linux_path(chromium_ok=False, browser_type=None):
122134
for binary in binaries:
123135
for path in paths:
124136
full_path = os.path.join(path, binary)
125-
if os.path.exists(full_path) and os.access(full_path, os.X_OK):
126-
return full_path
137+
try:
138+
if (
139+
os.path.exists(full_path)
140+
and os.access(full_path, os.R_OK)
141+
and os.access(full_path, os.X_OK)
142+
):
143+
return full_path
144+
except Exception:
145+
pass
127146
if chromium_ok:
128-
paths = ["/bin/chromium", "/bin/chromium-browser"]
147+
paths = [
148+
"/bin/chromium",
149+
"/bin/chromium-browser",
150+
"/usr/bin/chromium",
151+
"/usr/bin/chromium-browser"
152+
]
129153
for path in paths:
130-
if os.path.exists(path) and os.access(path, os.X_OK):
131-
return path
154+
try:
155+
if (
156+
os.path.exists(path)
157+
and os.access(path, os.R_OK)
158+
and os.access(path, os.X_OK)
159+
):
160+
return path
161+
except Exception:
162+
pass
132163
return "/usr/bin/google-chrome"
133164

134165

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
],
308308
# pip install -e .[psutil]
309309
"psutil": [
310-
"psutil==7.1.0",
310+
"psutil==7.1.2",
311311
],
312312
# pip install -e .[pyautogui]
313313
# (Already a required dependency on Linux now.)

0 commit comments

Comments
 (0)