From 81c4a36404b019bd3acac45127c63fa98a731bdd Mon Sep 17 00:00:00 2001 From: Yash-Singh1 Date: Fri, 13 Nov 2020 17:20:43 -0800 Subject: [PATCH 1/2] Added in browsh as a registered webbrowser --- Lib/webbrowser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 6023c1e13841d2..fd5d703de9e3d3 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -573,6 +573,9 @@ def register_standard_browsers(): # The w3m browser if shutil.which("w3m"): register("w3m", None, GenericBrowser("w3m")) + # The browsh browser + if shutil.which("browsh") and shutil.which("firefox"): + register("browsh", None, GenericBrowser(["browsh", "--startup-url", "%s"])) # OK, now that we know what the default preference orders for each # platform are, allow user to override them with the BROWSER variable. From d75cb39b65ba41bd6d050c3a57395a659c53a62f Mon Sep 17 00:00:00 2001 From: Yash-Singh1 Date: Fri, 13 Nov 2020 17:41:15 -0800 Subject: [PATCH 2/2] Added browsh into webbrowser docs --- Doc/library/webbrowser.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst index b7bfb655a71579..d7f15daa9920a3 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -141,6 +141,8 @@ for the controller classes, all defined in this module. +------------------------+-----------------------------------------+-------+ | ``'w3m'`` | :class:`GenericBrowser('w3m')` | | +------------------------+-----------------------------------------+-------+ +| ``'browsh'`` | :class:`GenericBrowser('browsh')` | | ++------------------------+-----------------------------------------+-------+ | ``'windows-default'`` | :class:`WindowsDefault` | \(2) | +------------------------+-----------------------------------------+-------+ | ``'macosx'`` | :class:`MacOSX('default')` | \(3) |