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

gh-102690: Use Edge as fallback in webbrowser instead of IE #102691

Merged
merged 9 commits into from
Mar 16, 2023
Merged
10 changes: 6 additions & 4 deletions Lib/webbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,13 @@ def register_standard_browsers():
# First try to use the default Windows browser
register("windows-default", WindowsDefault)

# Detect some common Windows browsers, fallback to IE
iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
"Internet Explorer\\IEXPLORE.EXE")
# Detect some common Windows browsers, fallback to Edge
edge = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"),
"Microsoft\\Edge\\Application\\msedge.exe")
edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
zooba marked this conversation as resolved.
Show resolved Hide resolved
"Microsoft\\Edge\\Application\\msedge.exe")
DBJim marked this conversation as resolved.
Show resolved Hide resolved
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
"netscape", "opera", iexplore):
"opera", edge, edge32):
if shutil.which(browser):
register(browser, None, BackgroundBrowser(browser))
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update :mod:`webbrowser` to fall back to Microsoft Edge instead of Internet Explorer.