Open the contents of your current view/tab in a web browser
Details
- Version 2016.07.12.00.59.24
- Homepage github.com
- Issues github.com
- Modified 4 years ago
- Last Seen 2 hours ago
- First Seen 8 years ago
Installs
- Total 371K
- Win 265K
- Mac 79K
- Linux 27K
Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 9 | 109 | 134 | 102 | 124 | 124 | 89 | 83 | 118 | 144 | 114 | 140 | 139 | 97 | 85 | 113 | 134 | 70 | 86 | 90 | 69 | 86 | 113 | 113 | 89 | 116 | 124 | 92 | 79 | 123 | 141 | 179 | 126 | 121 | 107 | 101 | 117 | 128 | 129 | 161 | 140 | 97 | 93 | 111 | 135 | 175 |
Mac | 3 | 21 | 32 | 29 | 43 | 20 | 23 | 18 | 16 | 23 | 22 | 41 | 26 | 17 | 16 | 30 | 13 | 18 | 24 | 22 | 19 | 15 | 21 | 22 | 19 | 23 | 22 | 24 | 18 | 26 | 23 | 17 | 18 | 23 | 11 | 29 | 30 | 36 | 24 | 36 | 21 | 19 | 17 | 25 | 31 | 37 |
Linux | 1 | 3 | 17 | 15 | 15 | 8 | 7 | 6 | 14 | 13 | 9 | 11 | 13 | 9 | 8 | 9 | 7 | 2 | 8 | 12 | 12 | 9 | 13 | 14 | 8 | 20 | 11 | 7 | 8 | 12 | 14 | 13 | 12 | 7 | 9 | 8 | 13 | 11 | 10 | 14 | 12 | 8 | 9 | 7 | 13 | 13 |
Readme
View In Browser is a Sublime Text plugin that will open whatever is in your current view/tab. If the file current open is new and has not been saved a temporary file is created (in your default temp directory for your OS) with the extension of .htm and your browser will open it. However if the current open file is saved and has a name this plugin will open it in whatever you have set to handle its type.
By default the keystroke assigned to this plugin is CTRL + ALT + V.
Installation
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 using another browser of your choice. To do this, choose Settings – User from Preferences > Package Settings > View In Browser.
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
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.
- CTRL + ALT + F – Firefox
- CTRL + ALT + C – Chrome
- CTRL + ALT + I – Internet Explorer
- CTRL + ALT + S – Safari
Like any other key binding in Sublime these can be changed. Below is an example of the key configuration. You can remap these in your User key bindings configuration file.
Windows Considerations
One of the things you may notice in the Windows configuration for chrome is a variable in the command path that looks like: %Local AppData%. This is a reference to your Windows installation’s AppData folder in your user profile directory. There is a variable there because this value will differ for each user on your computer, and Chrome installs to your AppData folder.
Here is a list of supported variables:
- AppData – Your main application data folder for your profile (usually roaming)
- Personal – Your documents location
- Desktop – The path to your Desktop location (may be unreliable)
- Start Menu – The path to your Start Menu items location
- Local AppData – Your local application data folder for your profile
- My Video – Path to your videos location
- My Pictures – Path to your pictures location
- My Music – Path to your music location
Note that many of these are not terribly useful for determining browser location, unless you have decided to install Firefox in your My Music folder.
Configure to View on Local Server
The View In Browser plugin also supports the ability to view files in the context of a local server. So if you have a local Apache, Tomcat, or some other server application running you can configure this plugin to open your file prefixed with a URL.
To configure this the View In Browser plugin reads the configuration of your currently loaded project. You can edit a project file by opening the sublime-project file by choosing Project -> Edit Project. In your project file you will need to specify two things:
- baseUrl – The root URL to prefix files with
- basePath – The base path where your site/application lives
Here’s how that looks.
Notice the key named settings which is a dictionary that contains another key named sublime-view-in-browser. This is where you will put your baseUrl and basePath settings.
Now when you activate View In Browser your file will open with the HTTP protocol instead of the FILE protocol.
Change History
- 03/11/2016:
- Fix issue where parenthesis in paths would cause a failure to load. Solves #52
Contributors
- Dorian Patterson – imaginationac
- Neil Freeman – fitnr
- Michael MacDonald – schlick
- Jadient – jadient
License
The MIT License (MIT) Copyright © 2012 Adam Presley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Open the contents of your current view/tab in a web browser
View In Browser is a Sublime Text plugin that will open whatever is in your current view/tab in your browser of choice. If the file you are working with is new and has not been saved then this plugin will save a temporary copy fo you and then open it up. View In Browser also works with local application servers to open your files using a URL prefix.
From this.
To this.
In just one keystroke.
Where To Start
To get started the View In Browser wiki has guides to aide in installation, browser configuration, and local server project configuration.
Change History
- 10/06/2014:
- Rewrite for version 2.0.0
- Using subprocess instead of webbrowser. Seems to solve #19
- Smaller, simplier sublime-settings file
Contributors
- Dorian Patterson – imaginationac
- Neil Freeman – fitnr
- Michael MacDonald – schlick
- Jadient – jadient
License
The MIT License (MIT) Copyright (c) 2012 Adam Presley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Hosted on GitHub Pages using the Dinky theme
If I write http://localhost/Otagtransit/index.php1 while wamp is on it is OK it works. But if I use view in browser plugin and press Ctrl+ALT+ F it goes to file:///D:/wamp/www/Otagtransit/index.php (here PHP codes are not run and are ommited).
In DW there is lengthy process for associating the Wamp server with DW. How can I associate Wamp server with sublime text 3 or correct the above path ( file:///D:/wamp/www/Otagtransit/index.php )
NOTE: A similar question has been asked but has received no answer
1 Answer 1
View in Browser’s documentation clearly describes how to do this. Make sure you are using a project to maintain your folders and files, then select Project -> Edit Project and add a settings section if it is not already there: