Movatterモバイル変換


[0]ホーム

URL:


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

gh-113539: Enable using$BROWSER to reorder default seach order in webbrowser.py#113561

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 9 commits intopython:mainfromronaldoussoren:gh-113539
Apr 25, 2025

Conversation

ronaldoussoren
Copy link
Contributor

@ronaldoussorenronaldoussoren commentedDec 29, 2023
edited by github-actionsbot
Loading

This PR makes it possible to use$BROWSER to reorder the list of registered (default) browsers, instead of always interpreting values as command-line tools.

The PR also fixes the registration for "chrome" on macOS, the app name is "google chrome" (and has been for years)

This is particularly useful on macOS where the default way to start a browser is not a command-line tool.


📚 Documentation preview 📚:https://cpython-previews--113561.org.readthedocs.build/

ronaldoussorenand others added5 commitsDecember 29, 2023 11:14
…Dkv9O.rstCo-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Copy link
Member

@sobolevnsobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we add a usage example somewhere? This feature is rather hard to comprehend.

@ronaldoussoren
Copy link
ContributorAuthor

Should we add a usage example somewhere? This feature is rather hard to comprehend.

The feature was hard to fully comprehend even before I made it more complex :-(

Adding some examples would definitely help, and it would be even better to slightly restructure the description of this feature. I'll see if I can come up with a better description.

BTW. Some other things I noticed (for different PRs):

  1. The list of supported browsers on macOS is not complete, we should at least add support for Microsoft Edge and possibly other popular non-mainstream browsers like Brave and Chromium.
  2. The table below the description ofwebbrowser.register is not correct for macOS, e.g. "chrome" is registered asMacOSXOSAScript("google chrome") and notChrome('chrome')

@hugovk
Copy link
Member

  1. The list of supported browsers on macOS is not complete, we should at least add support for Microsoft Edge and possibly other popular non-mainstream browsers like Brave and Chromium.

Not limited to macOS, but from thePlausible trial in July, here are the most popular browsers of people visiting docs.python.org:

Also not limited to macOS, here are the most popular desktop browsers used worldwide, fromstatscounter:

StatCounter-browser-ww-monthly-202211-202311-bar

And visitors tousa.gov sites (json), for macOS:

"Macintosh": {"Safari":260849550,"Chrome":201103500,"Firefox":16103981,"Edge":2024170,"Mozilla Compatible Agent":2018923,"Opera":552767,"YaBrowser":36155,"Whale Browser":15131,"DuckDuckGo Browser":5801,"Coc Coc":10339,"SeaMonkey":4535,"Aloha Browser":3174,"Maxthon":4181,"Mozilla":2253,"Internet Explorer":5163,"Waterfox":1837,"PaleMoon":139,"(not set)":215,"Vivaldi":748},

@minrk
Copy link
Contributor

minrk commentedFeb 21, 2025
edited
Loading

Given how the mac launchers work, I think it would also be sensible for$BROWSER to acceptapplication names, as the standard way to launch a URL with browser is e.g.open -a 'Google Chrome' URL (equivalent fortell application in current osascript implementation).

e.g.

ifshutil.which(cmd[0]):# on the command-lineGenericBrowserelse:# maybe check if app exists?OSAScript(app_name)

I'm not sure what the right backward-compatibility story is, or if that's appropriate if $BROWSER is a standard env expected to point to a shell executable.

Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the PR, I added a What's New entry based on the blurb.

@hugovkhugovk merged commit25e4984 intopython:mainApr 25, 2025
43 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sobolevnsobolevnsobolevn left review comments

@hugovkhugovkhugovk approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@ronaldoussoren@hugovk@minrk@sobolevn

[8]ページ先頭

©2009-2025 Movatter.jp