classification
Title: Register standard browser: Chrome
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eamanu, steve.dower, terry.reedy
Priority: normal Keywords: patch, patch

Created on 2018-12-27 13:36 by eamanu, last changed 2019-01-10 00:04 by steve.dower.

Pull Requests
URL Status Linked Edit
PR 11327 closed python-dev, 2018-12-29 03:06
Messages (4)
msg332586 - (view) Author: Emmanuel Arias (eamanu) * Date: 2018-12-27 13:36
Hi!

This issue is open to discuss the PR: https://github.com/python/cpython/pull/11327

This PR propose add "chrome" on webbrowser.register_standard_browsers for windows

IMO this is a reasonable new feature simply because Chrome is commonly used.
msg332697 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-12-29 03:27
As near as I can tell, this is *not* a duplicate of #8232.
msg333355 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-01-10 00:02
The patch won't work on my machine - "chrome[.exe]" is not on my PATH:

>>> import shutil
>>> shutil.which("chrome")
>>> import webbrowser
>>> webbrowser.register("chrome", None, webbrowser.BackgroundBrowser("chrome"))
>>> webbrowser.get("chrome")
<webbrowser.BackgroundBrowser object at 0x00000252203B40B8>
>>> webbrowser.get("chrome").open("https://stevedower.id.au/")
False

Perhaps this also requires an update to shutil.which() on Windows to inspect HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths?
msg333356 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-01-10 00:04
The "8232_1.patch" patch on #8232 implements a registry-based lookup (including for Chrome) that will be far more reliable than the current process's environment. So it's not a direct duplicate, but the proposed fix will resolve this issue as well.
History
Date User Action Args
2019-01-10 00:04:55steve.dowersetkeywords: patch, patch

messages: + msg333356
2019-01-10 00:02:46steve.dowersetkeywords: patch, patch
nosy: + steve.dower
messages: + msg333355

2018-12-29 03:28:03terry.reedysetpull_requests: - pull_request10652
2018-12-29 03:27:35terry.reedysetnosy: + terry.reedy
messages: + msg332697

keywords: patch, patch
stage: patch review ->
2018-12-29 03:06:58python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request10652
2018-12-29 03:06:56python-devsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10651
2018-12-27 13:36:19eamanucreate