Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update webbrowser.py to use Edge as fallback instead of IE
  • Loading branch information
DBJim committed Mar 14, 2023
commit c33c859d32306a5ac9bdfe771459cc3a8a914f0d
11 changes: 6 additions & 5 deletions Lib/webbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,12 @@ 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")
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
"netscape", "opera", iexplore):
# 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"),
Comment thread
zooba marked this conversation as resolved.
"Microsoft\\Edge\\Application\\msedge.exe")
Comment thread
DBJim marked this conversation as resolved.
Outdated
for browser in ("firefox", "firebird", "seamonkey", "mozilla", "opera", edge, edge32):
Comment thread
DBJim marked this conversation as resolved.
Outdated
if shutil.which(browser):
register(browser, None, BackgroundBrowser(browser))
else:
Expand Down