timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 74 forks source link

how to set custom 'browser_command' in windows? #80

Open naturs opened 8 years ago

Explorare commented 8 years ago

Same question. How to set Chrome in Windows 8.1 as default browser?

vongoh commented 8 years ago

I'm using Firefox Dev Edition as my main development browser, and the previews are opening up in my default O/S browser (Firefox).

As developers we could really use a setting to target specific browsers.

+1

wilfredw commented 8 years ago

Same question. How to set browser_command to launch preview using Google Chrome in Win10?

ansiz commented 8 years ago

@wilfredw @Explorare just set "browser_command": []

wbllwa commented 6 years ago

tks , just set "browser_command": [] is right ,because chrome is default browser

ansiz commented 6 years ago

@libowen0 @vongoh if you want to use customized browser instead of the system default browser on Windows

"browser_command": ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","{url}"] 

replace the first parameter with your own browser path.

geekyouth commented 5 years ago

@libowen0 @vongoh if you want to use customized browser instead of the system default browser on Windows

"browser_command": ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","{url}"] 

replace the first parameter with your own browser path.

but it do not work on my win10 computer 💥

yuyuanjingxuan commented 3 years ago

It should work by modifying:

"browser_command": ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","{url}"] 

If it is still not working, try to open your console for more details. I guess it will tell you the real issue:

  Traceback (most recent call last):
    File "....\OmniMarkupPreviewer\OmniMarkupPreviewer.py", line 81, in launching_web_browser_for_url
   ...
  TypeError: Type str doesn't support the buffer API

So the reason is that subprocess.Popen is reading binary data, instead of str. The solution is to comment the line:

# browser_command = [arg.encode(encoding) for arg in browser_command]

Here is how I solve the issue in my case.