Skip to content

Commit

Permalink
Added Canary as a browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Gailor committed Nov 4, 2013
1 parent 4481768 commit 0d23f3e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Side Bar.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"disabled_menuitem_empty": true,

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

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

Expand Down
26 changes: 26 additions & 0 deletions SideBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,32 @@ def try_open(self, url, browser):
])
commands = ['-new-tab', url]

elif browser == 'canary':
if sublime.platform() == 'osx':
items.extend(['open'])
commands = ['-a', '/Applications/Google Chrome Canary.app', url]
elif sublime.platform() == 'windows':
# read local app data path from registry
aKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
reg_value, reg_type = winreg.QueryValueEx (aKey, "Local AppData")

if s.get('portable_browser') != '':
items.extend([s.get('portable_browser')])
items.extend([
'%HOMEPATH%\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'

,reg_value+'\\Chrome SxS\\Application\\chrome.exe'
,reg_value+'\\Google\\Chrome SxS\\Application\\chrome.exe'
,'%HOMEPATH%\\Google\\Chrome SxS\\Application\\chrome.exe'
,'%PROGRAMFILES%\\Google\\Chrome SxS\\Application\\chrome.exe'
,'%PROGRAMFILES(X86)%\\Google\\Chrome SxS\\Application\\chrome.exe'
,'%USERPROFILE%\\Local\ Settings\\Application\ Data\\Google\\Chrome SxS\\chrome.exe'
,'%HOMEPATH%\\Local\ Settings\\Application\ Data\\Google\\Chrome SxS\\Application\\chrome.exe'
,'%HOMEPATH%\\Local Settings\\Application Data\\Google\\Chrome SxS\\Application\\chrome.exe'
])

commands = ['-new-tab', url]

elif browser == 'chromium':
if sublime.platform() == 'osx':
items.extend(['open'])
Expand Down

0 comments on commit 0d23f3e

Please sign in to comment.