BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.18k stars 756 forks source link

the bs-config.json option for browser choice not working #1029

Open myusrn opened 8 years ago

myusrn commented 8 years ago

Issue details

On my dev wks I have edge, ie and chrome installed with edge as my default.
When the lite-server package [ https://www.npmjs.com/package/lite-server ], which is built on top of browsersync and is referenced for use in ng2 5 minute quick start [ https://angular.io/docs/ts/latest/quickstart.html ] , kicks off it launches using whatever my default browser setting is. I tested the https://www.browsersync.io/docs/options/ described bs-config.json setting "browser" : "internet explorer" and "browser" : "google chrome" to enable launching using either of those installed options instead of my default "microsoft edge" browser for those browsersync enabled debugging sessions and it always launches using my default edge browser.

Steps to reproduce/test case

Clone https://github.com/myusrn/vscng2qs and execute "npm run" on dev wks with default brower set to something other than brower setting(s) defined in bs-config.json.

Please specify which version of Browsersync, node and npm you're running

npm run lite [ where this is configured to execute npm lite-server package that is built on top of browsersync ]

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

{Browsersync init code here}

jjernberg commented 8 years ago

I had a similar issue. After some messing around with the config I found that rather than have "google chrome", as the docs say, it should be just "chrome".

myusrn commented 8 years ago

thanks for the followup on this and value to use to get chrome vs my default edge browser launched. It appears that with chrome and internet explorer instead of what the documentation specifies you use what the name of the executable is, i.e.

"browser": "chrome" // to get google chrome vs default browser launched "browser": "iexplore" // to get internet explorer vs default browser launched "browser": "edge???" // to get microsoft edge vs default browser launched

will someone be updating https://www.browsersync.io/docs/options/#option-browser documentation to reflect actual values that one uses or simply to confirm that the name expected is whatever the browser's executable file name is?

arghlolrofl commented 8 years ago

Hi, I recently ran into a similar problem. My default browser is Firefox but I wanted my lite-server (which is using browser-sync) to launch my project inside Edge.

I just want to share my workaround for this:

  1. create (or open) the bs-config.json file
  2. search for the line "browser": [ "xxx" ]
  3. to open your project with Edge, replace "xxx" with "microsoft-edge:"

See also http://www.intowindows.com/...

ghost commented 8 years ago

If using Gulp, you need to write "microsoft-edge:http://selected-host:3000" in the browser options. Writing "microsoft-edge:" alone is not enough.

vis97c commented 4 years ago

If using Gulp, you need to write "microsoft-edge:http://selected-host:3000" in the browser options. Writing "microsoft-edge:" alone is not enough.

For people looking how to open edge, using "microsoft-edge:" will open an empty or the default startup page of edge browser, so after the ":" you have to provide the link you want it to open, for example:

"microsoft-edge:http://localhost:3000"