From c4e55876703545e886ff52fda58999381274a9cd Mon Sep 17 00:00:00 2001 From: Trevor Sayre Date: Tue, 9 May 2017 14:59:58 -0400 Subject: [PATCH 1/4] Add commands for "default" option --- View In Browser.sublime-settings | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/View In Browser.sublime-settings b/View In Browser.sublime-settings index 73d5b5a..2da6b83 100644 --- a/View In Browser.sublime-settings +++ b/View In Browser.sublime-settings @@ -1,18 +1,21 @@ { "posix": { "linux": { + "default": "xdg-open", "firefox": "firefox -new-tab", "chrome": "google-chrome", "chrome64": "google-chrome", "chromium": "chromium" }, "linux2": { + "default": "xdg-open", "firefox": "firefox -new-tab", "chrome": "google-chrome", "chrome64": "google-chrome", "chromium": "chromium" }, "darwin": { + "default": "open", "firefox": "open -a \"/Applications/Firefox.app\"", "safari": "open -a \"/Applications/Safari.app\"", "chrome": "open -a \"/Applications/Google Chrome.app\"", @@ -22,6 +25,7 @@ }, "nt": { "win32": { + "default": "start", "firefox": "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe -new-tab", "iexplore": "C:\\Program Files\\Internet Explorer\\iexplore.exe", "chrome": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", @@ -30,5 +34,5 @@ } }, - "browser": "firefox" + "browser": "default" } From 3f92401f7c5f667fe7a32923a7f21a3e5fd88f88 Mon Sep 17 00:00:00 2001 From: Trevor Sayre Date: Tue, 9 May 2017 15:15:29 -0400 Subject: [PATCH 2/4] Update README for default browser --- README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 83287b8..9594972 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,29 @@ By default the keystroke assigned to this plugin is *CTRL + ALT + V*. Using the Sublime Text Package Control plugin (http://wbond.net/sublime_packages/package_control) press *CTRL + SHIFT + P* and find **Package Control: Install Package** and press *Enter*. Find this plugin in the list by name **View In Browser**. ## Configuring Browsers -By default this plugin will open files in Firefox. You can configure it to open +By default this plugin will open files in your default browser. You can configure it to open using another browser of your choice. To do this, choose *Settings - User* from *Preferences > Package Settings > View In Browser*. +For example, to set Chrome as your default browser: + +```JSON +{ + "browser": "chrome" +} +``` + The browser you wish to use to open files is set in the key named **browser**. The following is a list of browsers configured for use out of the box. -* Firefox - Mac OS, Linux, Windows -* Chrome - Mac OS, Linux, Windows -* Chrome64 - Windows -* Yandex - Windows -* Safari - Mac OS -* Internet Explorer - Windows -* Chromium - Linux +|Browser|Value|Supported OS| +|---|---|---| +|Default|`default`|macOS, Linux, Windows| +|Firefox|`firefox`|macOS, Linux, Windows| +|Chrome|`chrome`|macOS, Linux, Windows| +|Chrome64|`chrome64`|Windows| +|Yandex|`yandex`|Windows| +|Safari|`safari`|macOS| +|Internet Explorer|`iexplore`|Windows| +|Chromium|`chromium`|macOS, Linux| ## Other Browsers View In Browser also provides key bindings to open your current view in browser other than your **browser** setting. Below is a listing of the keys and what browser open with those key bindings. @@ -91,6 +102,8 @@ Now when you activate View In Browser your file will open with the HTTP protocol ## Change History +* 05/09/2017: + * Add support for default browser * 03/11/2016: * Fix issue where parenthesis in paths would cause a failure to load. Solves #52 * 10/06/2014: From c1245bab456afa1fbbeac07e45bafbbb89d96a77 Mon Sep 17 00:00:00 2001 From: Trevor Sayre Date: Mon, 12 Jun 2017 09:40:52 -0400 Subject: [PATCH 3/4] Fix Chromium for Linux --- View In Browser.sublime-settings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/View In Browser.sublime-settings b/View In Browser.sublime-settings index 2da6b83..9949aa7 100644 --- a/View In Browser.sublime-settings +++ b/View In Browser.sublime-settings @@ -5,14 +5,14 @@ "firefox": "firefox -new-tab", "chrome": "google-chrome", "chrome64": "google-chrome", - "chromium": "chromium" + "chromium": "chromium-browser" }, "linux2": { "default": "xdg-open", "firefox": "firefox -new-tab", "chrome": "google-chrome", "chrome64": "google-chrome", - "chromium": "chromium" + "chromium": "chromium-browser" }, "darwin": { "default": "open", From abeefaff00f2503b209e16f8c1b6859cb2f7f01e Mon Sep 17 00:00:00 2001 From: Trevor Sayre Date: Mon, 12 Jun 2017 09:41:10 -0400 Subject: [PATCH 4/4] Add Chromium for macOS --- View In Browser.sublime-settings | 1 + 1 file changed, 1 insertion(+) diff --git a/View In Browser.sublime-settings b/View In Browser.sublime-settings index 9949aa7..e154097 100644 --- a/View In Browser.sublime-settings +++ b/View In Browser.sublime-settings @@ -20,6 +20,7 @@ "safari": "open -a \"/Applications/Safari.app\"", "chrome": "open -a \"/Applications/Google Chrome.app\"", "chrome64": "open -a \"/Applications/Google Chrome.app\"", + "chromium": "open -a \"/Applications/Chromium.app\"", "yandex": "open -a \"/Applications/Yandex.app\"" } },