Sublime Text 3 - 'Open in Browser' stopped working [Solved]

For no ‘apparent’ reason today when I right click anywhere in the open index.html file in sublime text 3, and click the ‘OPEN’ in browser nothing happens. Before it used to open my file in the Chrome browser.
I can still open in firefox using Ctrl Alt + V…but its frustrating.

Does anyone know what has happened? I’ve looked at many pages online about this and to be honest they are all technically beyond me without a ‘simple’ explanation - I’m no 12 year old tech whizz kid!!!

Thanks in advance :thumbsup:

Only thing that comes to mind is maybe reseting your default application for html files maybe? Im not entirely sure why you would have to do that, but its the only thing that comes to mind.

Otherwise. I would try these basic troubleshoot stuff. Cant think of the right words at the moment

  • Restart Computer. Annoying yes… but… well… yea… annoying

Have you tried scanning the console output for errors (CTRL+`)? It might show you something interesting.

1 Like

Thanks for your replies.

I’m afraid even your suggestions leave me thinking - what do they mean and how do I do what they suggested?

How do I reset the default application for html files?

Scan the console output for errors?
Do you mean the browser console window in developer tools? And which way should I open the browser to then inspect the console as my Sublime text 3 will no longer open in chrome?

Sorry if this is basic stuff but I genuinely do not understand this tech

Sublime Text has a Python console that’s accessible with CTRL+`. Sometimes errors are output there for debugging.

Which operating system are you on? Did you install a plugin to open in browser? If so, which other plugins do you have?

I like Sublime for some things, but I’ve found that for creating websites Brackets works really well for me. It has a LivePreview feature that you just click and it opens the page in your browser. Any changes you make to the code (html, javascript, css, etc) is updated instantly without having to save or reload the page in your browser. If you continue to have trouble with your Sublime, maybe give this a try.

hi, thanks. Ivegot brackets and used it a bit.
For some unknown reason I gravitated towards the sublime interface :slight_smile:
But my files do open up fine in the chrome browser from there :slight_smile:

hi,
I am using sublime on windows 10 (urrrggghhh).
I have installed the ‘view in browser’ package which works with Ctrl Alt V but only seems toopen firefox.

When I view the sublime console (thanks for explanation) nothing whatsoever appears in it when I right click screen and select “OPEN in browser”. But every other action brings up messages in the console.

To choose your default app for .html files. Find any random .html file on your computer.
Right click it > Properties > The opens with thing > Change
Then just click chrome. Chances are its probably already on chrome but… Who knows.

Also… Sublime text is just the editor. A free one at that. Theres a REALLY REALLY high chance the above solution isn’t going to work. As a last resort you might want to reinstall your sublime text. Make sure when you uninstall it that you tell it NOT to save any preferences.

If that dosnt work then… well… hopefully that works. :thumbsup:

PS: Just checked my sublime text. Right click > Open to browser dosnt output anything to the console for me.

2 Likes

Hi,

Guess what - it DID work!!
:fireworks:
And I know why it happened…

Earlier I changed the default of my index.html file to open in sublime text. I thought it would open in that rather than wanting to open in brackets.

So following your advice I right clicked on html file. I had tried this earlier on and it didn’t work BUT i forgot to check the box to make it always use same app and selected chrome.

Thanks everyone for you answers…I learned a few extra things too so ALL GOOD!!!
:thumbsup:

1 Like

Resetting the default browser in Control Panel -> Programs -> Set Your Default Programs, worked for me. This is for Windows 7 btw.

1 Like

The open in browser or view in browser has never worked for me. Have MAC any suggestions?

This highlighted the issue for me and was useful to know the console exists.
With the panel up, it essentially was saying it couldn’t locate the firefox.exe file.
So I went to

  • Sublime Preferences
  • Package Settings > View in browser > Settings - Default
  • The file path was incorrect for my firefox.exe, so just needed to amend and save
  • i ended up changing the last line to: “browser”: “chrome” and saved as i wanted to open in Chrome anyway.

Thank you for the help!!

2 Likes

Your response was the real help. It seems that the plugin doesn’t use the Windows file association at all (maybe it was like that before?).
You need to manually fix the paths in the plugin config file as you said.

Thanks.

Hello everybody. what can I do if when I open preferences I don’t find there phrase view in browser, and actually no information about browser?

Thank you. I appreciate your effort.

Thanks! Your solution worked for me.

1 Like

ya that works man it was really a small but significant one