Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should respect OS user preferences rather than default to a "better" browser #45

Open
Chudesnov opened this issue Aug 23, 2022 · 0 comments

Comments

@Chudesnov
Copy link

Since this package is widely used (by Storybook, Gatsby, and others) and it's not easy to find docs on how it is supposed to be configured (via the BROWSER environment variable, I believe), I would suggest that this package checks user OS preferences first before defaulting to something like:

  const shouldTryOpenChromiumWithAppleScript =
    process.platform === 'darwin' &&
    (typeof browser !== 'string' || browser === OSX_CHROME);

(https://github.com/michaellzc/better-opn/blob/master/src/index.js#L53)

(For me personally, it was non-straightforward that Gatsby always opened my dev build in Chrome even though it's not my default browser, even if that allowed some advanced behaviour like re-using the same tab).

We can detect the default browser through a package like x-default-browser, and if it is indeed one of the supported Chromium browsers, then it should, of course utilise its advanced capabilities.

Any thoughts on that? Happy to send in a PR to add OS preferences checking and do the necessary work to ensure backward compatibility if you're okay with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant