mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)
This commit is contained in:
parent
2a03ed034e
commit
1c9f3391b9
2 changed files with 9 additions and 4 deletions
|
@ -542,11 +542,15 @@ def register_standard_browsers():
|
||||||
# First try to use the default Windows browser
|
# First try to use the default Windows browser
|
||||||
register("windows-default", WindowsDefault)
|
register("windows-default", WindowsDefault)
|
||||||
|
|
||||||
# Detect some common Windows browsers, fallback to IE
|
# Detect some common Windows browsers, fallback to Microsoft Edge
|
||||||
iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
|
# location in 64-bit Windows
|
||||||
"Internet Explorer\\IEXPLORE.EXE")
|
edge64 = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"),
|
||||||
|
"Microsoft\\Edge\\Application\\msedge.exe")
|
||||||
|
# location in 32-bit Windows
|
||||||
|
edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
|
||||||
|
"Microsoft\\Edge\\Application\\msedge.exe")
|
||||||
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
|
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
|
||||||
"netscape", "opera", iexplore):
|
"opera", edge64, edge32):
|
||||||
if shutil.which(browser):
|
if shutil.which(browser):
|
||||||
register(browser, None, BackgroundBrowser(browser))
|
register(browser, None, BackgroundBrowser(browser))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Update :mod:`webbrowser` to fall back to Microsoft Edge instead of Internet Explorer.
|
Loading…
Add table
Add a link
Reference in a new issue