Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

Commit bf79bb8

Browse files
authored
fix(mac,chrome): search for chromium also (#279)
1 parent cfdd343 commit bf79bb8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

eel/chrome.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def find_path():
2020
if sys.platform in ['win32', 'win64']:
2121
return _find_chrome_win()
2222
elif sys.platform == 'darwin':
23-
return _find_chrome_mac()
23+
return _find_chrome_mac() or _find_chromium_mac()
2424
elif sys.platform.startswith('linux'):
2525
return _find_chrome_linux()
2626
else:
@@ -33,12 +33,24 @@ def _find_chrome_mac():
3333
return default_dir
3434
# use mdfind ci to locate Chrome in alternate locations and return the first one
3535
name = 'Google Chrome.app'
36-
alternate_dirs = [x for x in sps.check_output(["mdfind", name]).decode().split('\n') if x.endswith(name)]
36+
alternate_dirs = [x for x in sps.check_output(["mdfind", name]).decode().split('\n') if x.endswith(name)]
3737
if len(alternate_dirs):
3838
return alternate_dirs[0] + '/Contents/MacOS/Google Chrome'
3939
return None
4040

4141

42+
def _find_chromium_mac():
43+
default_dir = r'/Applications/Chromium.app/Contents/MacOS/Chromium'
44+
if os.path.exists(default_dir):
45+
return default_dir
46+
# use mdfind ci to locate Chromium in alternate locations and return the first one
47+
name = 'Chromium.app'
48+
alternate_dirs = [x for x in sps.check_output(["mdfind", name]).decode().split('\n') if x.endswith(name)]
49+
if len(alternate_dirs):
50+
return alternate_dirs[0] + '/Contents/MacOS/Chromium'
51+
return None
52+
53+
4254
def _find_chrome_linux():
4355
import whichcraft as wch
4456
chrome_names = ['chromium-browser',

0 commit comments

Comments
 (0)