@@ -96,14 +96,9 @@ def linux_browser_apps_to_cmd(*apps):
96
96
)
97
97
98
98
99
- def chrome_on_linux_path (prefer_chromium = False ):
99
+ def chrome_on_linux_path (chromium_ok = False ):
100
100
if os_name () != OSType .LINUX :
101
101
return ""
102
- if prefer_chromium :
103
- paths = ["/bin/chromium" , "/bin/chromium-browser" ]
104
- for path in paths :
105
- if os .path .exists (path ) and os .access (path , os .X_OK ):
106
- return path
107
102
paths = ["/bin/google-chrome" , "/bin/google-chrome-stable" ]
108
103
for path in paths :
109
104
if os .path .exists (path ) and os .access (path , os .X_OK ):
@@ -112,17 +107,22 @@ def chrome_on_linux_path(prefer_chromium=False):
112
107
binaries = []
113
108
binaries .append ("google-chrome" )
114
109
binaries .append ("google-chrome-stable" )
115
- binaries .append ("chrome" )
116
- binaries .append ("chromium" )
117
- binaries .append ("chromium-browser" )
118
110
binaries .append ("google-chrome-beta" )
119
111
binaries .append ("google-chrome-dev" )
120
112
binaries .append ("google-chrome-unstable" )
113
+ binaries .append ("chrome" )
114
+ binaries .append ("chromium" )
115
+ binaries .append ("chromium-browser" )
121
116
for binary in binaries :
122
117
for path in paths :
123
118
full_path = os .path .join (path , binary )
124
119
if os .path .exists (full_path ) and os .access (full_path , os .X_OK ):
125
120
return full_path
121
+ if chromium_ok :
122
+ paths = ["/bin/chromium" , "/bin/chromium-browser" ]
123
+ for path in paths :
124
+ if os .path .exists (path ) and os .access (path , os .X_OK ):
125
+ return path
126
126
return "/usr/bin/google-chrome"
127
127
128
128
@@ -209,12 +209,11 @@ def windows_browser_apps_to_cmd(*apps):
209
209
return '%s -NoProfile "%s"' % (powershell , script )
210
210
211
211
212
- def get_binary_location (browser_type , prefer_chromium = False ):
213
- """Return the full path of the browser binary.
214
- If going for better results in UC Mode, use: prefer_chromium=True"""
212
+ def get_binary_location (browser_type , chromium_ok = False ):
213
+ """Return the full path of the browser binary."""
215
214
cmd_mapping = {
216
215
ChromeType .GOOGLE : {
217
- OSType .LINUX : chrome_on_linux_path (prefer_chromium ),
216
+ OSType .LINUX : chrome_on_linux_path (chromium_ok ),
218
217
OSType .MAC : r"/Applications/Google Chrome.app"
219
218
r"/Contents/MacOS/Google Chrome" ,
220
219
OSType .WIN : chrome_on_windows_path (),
0 commit comments