[Python-checkins] cpython: Issue 13620 - Support chrome browser in webbrowser.py module.
senthil.kumaran
python-checkins at python.org
Wed Dec 21 15:31:53 CET 2011
http://hg.python.org/cpython/rev/7faa90a6324c
changeset: 74110:7faa90a6324c
user: Senthil Kumaran <senthil at uthcode.com>
date: Wed Dec 21 22:20:32 2011 +0800
summary:
Issue 13620 - Support chrome browser in webbrowser.py module.
files:
Lib/webbrowser.py | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -299,6 +299,18 @@
background = True
+class Chrome(UnixBrowser):
+ "Launcher class for Google Chrome browser."
+
+ remote_args = ['%action', '%s']
+ remote_action = ""
+ remote_action_newwin = "--new-window"
+ remote_action_newtab = ""
+ background = True
+
+Chromium = Chrome
+
+
class Opera(UnixBrowser):
"Launcher class for Opera browser."
@@ -466,6 +478,11 @@
if _iscommand("skipstone"):
register("skipstone", None, BackgroundBrowser("skipstone"))
+ # Google Chrome/Chromium browsers
+ for browser in ("google-chrome", "chrome", "chromium", "chromium-browser"):
+ if _iscommand(browser):
+ register(browser, None, Chrome(browser))
+
# Opera, quite popular
if _iscommand("opera"):
register("opera", None, Opera("opera"))
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list