summaryrefslogtreecommitdiffstats
path: root/Lib/webbrowser.py
diff options
context:
space:
mode:
authorJamoo721 <81095953+Jamoo721@users.noreply.github.com>2023-03-16 02:52:11 (GMT)
committerGitHub <noreply@github.com>2023-03-16 02:52:11 (GMT)
commit1c9f3391b916939e5ad18213e553f8d6bfbec25e (patch)
tree0cea2f23d3d12a3d08a942c68e94603fb13cb684 /Lib/webbrowser.py
parent2a03ed034edc6bb2db6fb972b2efe08db5145a28 (diff)
downloadcpython-1c9f3391b916939e5ad18213e553f8d6bfbec25e.zip
cpython-1c9f3391b916939e5ad18213e553f8d6bfbec25e.tar.gz
cpython-1c9f3391b916939e5ad18213e553f8d6bfbec25e.tar.bz2
gh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)
Diffstat (limited to 'Lib/webbrowser.py')
-rwxr-xr-xLib/webbrowser.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 44974d4..a56ff33 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -542,11 +542,15 @@ 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 Microsoft Edge
+ # location in 64-bit Windows
+ 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",
- "netscape", "opera", iexplore):
+ "opera", edge64, edge32):
if shutil.which(browser):
register(browser, None, BackgroundBrowser(browser))
else: