BrowserSync / browser-sync

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

Feature Request: parameters for opening in browsers #1650

Open Julix91 opened 5 years ago

Julix91 commented 5 years ago

Issue details

I'd like to open various browsers with parameters (to specify size and position).

opn (which is used in openBrowser function) supports passing arguments

// Specify app arguments
opn('http://sindresorhus.com', {app: ['google chrome', '--incognito']});

But BrowserSync's code doesn't parse them anywhere as far as I can tell. For now I shall deactivate BrowserSync's opening and see if I can implement it by calling opn myself, but I think it would be quite easy to include some parsing for -- or - (with space in front). Maybe I'll give it a try and if I find it might submit pull request for it.

The idea would be to set option to browser: [ 'google chrome --incognito --...', 'firefox -private-window', etc]

marcnischan commented 4 years ago

Hi Julix, did you ever find a solution to this? I would loooove to be able to open an incognito browser from browser-sync.

Julix91 commented 4 years ago

I never did get around to fixing it and making a PR, but I think that's what the solutions would have to be. Parse the input and pass it along. Guess if there's malicious parameters that I don't know about then that might introduce some amount of risk, so not sure if a dictionary of acceptable parameters or such is needed. I'd assume not?

marcnischan commented 4 years ago

My main reason for wanting it is for local Wordpress development. The malicious parameters are over my head from a technical standpoint. :) Thanks for the response!