summaryrefslogtreecommitdiffstats
path: root/Lib/webbrowser.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-30 17:16:33 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-30 17:16:33 (GMT)
commitc9b750d249136b88125c28cd139c4bc694c18003 (patch)
tree7b6a48922d0c0156d5d411382fd5f636347601a6 /Lib/webbrowser.py
parent32c0d3ada52109f339c081d3408546a4af024b3c (diff)
downloadcpython-c9b750d249136b88125c28cd139c4bc694c18003.zip
cpython-c9b750d249136b88125c28cd139c4bc694c18003.tar.gz
cpython-c9b750d249136b88125c28cd139c4bc694c18003.tar.bz2
Issue #23262: The webbrowser module now supports Firefox 36+ and derived
browsers. Based on patch by Oleg Broytman.
Diffstat (limited to 'Lib/webbrowser.py')
-rwxr-xr-xLib/webbrowser.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 0292c3a..6f43b7f 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -245,7 +245,17 @@ class UnixBrowser(BaseBrowser):
class Mozilla(UnixBrowser):
- """Launcher class for Mozilla/Netscape browsers."""
+ """Launcher class for Mozilla browsers."""
+
+ remote_args = ['%action', '%s']
+ remote_action = ""
+ remote_action_newwin = "-new-window"
+ remote_action_newtab = "-new-tab"
+ background = True
+
+
+class Netscape(UnixBrowser):
+ """Launcher class for Netscape browser."""
raise_opts = ["-noraise", "-raise"]
remote_args = ['-remote', 'openURL(%s%action)']
@@ -254,8 +264,6 @@ class Mozilla(UnixBrowser):
remote_action_newtab = ",new-tab"
background = True
-Netscape = Mozilla
-
class Galeon(UnixBrowser):
"""Launcher class for Galeon/Epiphany browsers."""
@@ -430,14 +438,18 @@ def register_X_browsers():
if shutil.which("x-www-browser"):
register("x-www-browser", None, BackgroundBrowser("x-www-browser"))
- # The Mozilla/Netscape browsers
- for browser in ("mozilla-firefox", "firefox",
- "mozilla-firebird", "firebird",
- "iceweasel", "iceape",
- "seamonkey", "mozilla", "netscape"):
+ # The Mozilla browsers
+ for browser in ("firefox", "iceweasel", "iceape", "seamonkey"):
if shutil.which(browser):
register(browser, None, Mozilla(browser))
+ # The Netscape and old Mozilla browsers
+ for browser in ("mozilla-firefox",
+ "mozilla-firebird", "firebird",
+ "mozilla", "netscape"):
+ if shutil.which(browser):
+ register(browser, None, Netscape(browser))
+
# Konqueror/kfm, the KDE browser.
if shutil.which("kfm"):
register("kfm", Konqueror, Konqueror("kfm"))