Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions Doc/library/webbrowser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ for the controller classes, all defined in this module.
+------------------------+-----------------------------------------+-------+
| ``'iosbrowser'`` | ``IOSBrowser`` | \(4) |
+------------------------+-----------------------------------------+-------+
| ``'firefox-'`` | ``Mozilla('mozilla')`` | \(5) |
+------------------------+-----------------------------------------+-------+

Notes:

Expand All @@ -205,6 +207,10 @@ Notes:
(4)
Only on iOS.

(5)
firefox- are Firefox channels, such as firefox-dev, firefox-aurora,
firefox-beta, firefox-nightly, etc.

.. versionadded:: 3.2
A new :class:`!MacOSXOSAScript` class has been added
and is used on Mac instead of the previous :class:`!MacOSX` class.
Expand Down
11 changes: 11 additions & 0 deletions Lib/webbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import subprocess
import threading
import glob

__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]

Expand Down Expand Up @@ -486,6 +487,16 @@ def register_X_browsers():
if shutil.which("microsoft-edge"):
register("microsoft-edge", None, Edge("microsoft-edge"))

# firefox-dev, firefox-aurora,firefox-beta, firefox-nightly, etc.
firefox_channels = {
name
for path_dir in os.environ["PATH"].split(os.pathsep)
for exe in glob.glob(os.path.join(path_dir, "firefox-*"))
if (name := os.path.basename(exe)) and shutil.which(name)
}

for browser in firefox_channels:
register(browser, None, Mozilla(browser))

def register_standard_browsers():
global _tryorder
Expand Down
Loading