Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Feature request] option too choose web browser #565

Unanswered
jimblue asked this question in Ideas
Discussion options

Hi,

Actually webpack-bundle-analyzer doesn't offer an option to choose which browser open.

The option can only be set to default or null.

As many people use a different browser for development than for browsing it could be nice to have such choice.

Cheers

You must be logged in to vote

Replies: 12 comments

Comment options

Hey,

Any update about this?

Cheers!

You must be logged in to vote
0 replies
Comment options

The underlying package we use is opener and it will open the default browser you've configured.

I'd like to avoid adding a new configuration option for the browser, so I'm hesitant on adding this feature.

You must be logged in to vote
0 replies
Comment options

Hey!

Why not? It will not break anything, only add flexibility, which is always good 😄!

Consider that peoples often use two browsers, it would be a nice feature to add:

  • the default OS browser for everyday use to keep deep integration with the system
  • google chrome browser for development (the more often)

Cheers

You must be logged in to vote
0 replies
Comment options

It could be also useful for developer using webpack-bundle-analyzer in their library...

You must be logged in to vote
0 replies
Comment options

To make it even better, I'll suggest to replace opener with open .
This package have more stars and is better maintain.
Also the API is way better. it has much more options and it return a promise when the opened app exit. 😃

You must be logged in to vote
0 replies
Comment options

which is always good

Additional flexibility is a double-edged sword. It makes the API surface larger, making the tool harder to use as documentation grows longer. Adding new options also introduces maintenance burden as we will need to make sure the new feature does not accidentally break.

We don't currently have the testing infrastructure for the openAnalyzer flag, and adding more features like that will make it much more likely for us to break it in the future.

So that is why I am not eagerly adding this feature.

You must be logged in to vote
0 replies
Comment options

Additional flexibility is a double-edged sword

I would be agree if it was a huge add, but it's just easy as passing browser argument from webpack-bundle-analyzer to open.

How could that break anything or make future that more complicated?

I don't get it honestly...

You must be logged in to vote
0 replies
Comment options

I would probably wait until sindresorhus/open#116 is implemented.

You must be logged in to vote
0 replies
Comment options

Thanks @sindresorhus, looks like that would indeed help.

You must be logged in to vote
0 replies
Comment options

FWIW: Until/if this is supported, you can hack around it with a script that overrides xdg-open or open on Linux and Mac.

e.g. I put this script named xdg-open in a directory that comes before /usr/bin in $PATH.

#!/bin/sh
if test -n "$XDG_OPEN"; then
	$XDG_OPEN "$@"
else
	/usr/bin/xdg-open "$@"
fi

And it allows me to choose my browser in the package.json script e.g. XDG_OPEN=browser ...webpack-build-command....

You must be logged in to vote
0 replies
Comment options

Hi there,
Just a friendly ping as the dependency issue seems close now : sindresorhus/open#116
Is this issue status is still blocked ?

You must be logged in to vote
0 replies
Comment options

Might not be, maybe a dependency bump is needed with this feature. Feel free to create a PR :)

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Converted from issue

This discussion was converted from issue #216 on February 23, 2023 09:10.

AltStyle によって変換されたページ (->オリジナル) /