Skip to content

Commit 0d23f3e

Browse files
author
Jeremy Gailor
committed
Added Canary as a browser
1 parent 4481768 commit 0d23f3e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

Side Bar.sublime-settings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"disabled_menuitem_empty": true,
2525

2626
//if installed in a default location maybe this works.
27-
"default_browser": "", //one of this list: firefox, chrome, chromium, opera, safari
27+
"default_browser": "", //one of this list: firefox, chrome, canary, chromium, opera, safari
2828

2929
"portable_browser": "", // for example: C:/Program Files (x86)/Nightly/firefox.exe
3030

SideBar.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,32 @@ def try_open(self, url, browser):
13481348
])
13491349
commands = ['-new-tab', url]
13501350

1351+
elif browser == 'canary':
1352+
if sublime.platform() == 'osx':
1353+
items.extend(['open'])
1354+
commands = ['-a', '/Applications/Google Chrome Canary.app', url]
1355+
elif sublime.platform() == 'windows':
1356+
# read local app data path from registry
1357+
aKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
1358+
reg_value, reg_type = winreg.QueryValueEx (aKey, "Local AppData")
1359+
1360+
if s.get('portable_browser') != '':
1361+
items.extend([s.get('portable_browser')])
1362+
items.extend([
1363+
'%HOMEPATH%\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'
1364+
1365+
,reg_value+'\\Chrome SxS\\Application\\chrome.exe'
1366+
,reg_value+'\\Google\\Chrome SxS\\Application\\chrome.exe'
1367+
,'%HOMEPATH%\\Google\\Chrome SxS\\Application\\chrome.exe'
1368+
,'%PROGRAMFILES%\\Google\\Chrome SxS\\Application\\chrome.exe'
1369+
,'%PROGRAMFILES(X86)%\\Google\\Chrome SxS\\Application\\chrome.exe'
1370+
,'%USERPROFILE%\\Local\ Settings\\Application\ Data\\Google\\Chrome SxS\\chrome.exe'
1371+
,'%HOMEPATH%\\Local\ Settings\\Application\ Data\\Google\\Chrome SxS\\Application\\chrome.exe'
1372+
,'%HOMEPATH%\\Local Settings\\Application Data\\Google\\Chrome SxS\\Application\\chrome.exe'
1373+
])
1374+
1375+
commands = ['-new-tab', url]
1376+
13511377
elif browser == 'chromium':
13521378
if sublime.platform() == 'osx':
13531379
items.extend(['open'])

0 commit comments

Comments
 (0)