ladybird/Ports/python3/patches/webbrowser.patch
Linus Groh 9f970c3459 Ports: Register Browser in the Python webbrowser module
This makes the following work:

    >>> import webbrowser
    >>> webbrowser.open("http://serenityos.org")

As well as this well-known easter egg:

    >>> import antigravity

Pretty cool! :^)
2021-05-06 14:26:09 +01:00

12 lines
532 B
Diff

--- Python-3.9.5/Lib/webbrowser.py 2021-05-03 15:54:42.000000000 +0100
+++ Python-3.9.5/Lib/webbrowser.py 2021-05-06 14:21:34.242964786 +0100
@@ -574,6 +574,9 @@
if shutil.which("w3m"):
register("w3m", None, GenericBrowser("w3m"))
+ # SerenityOS Browser
+ register("Browser", None, BackgroundBrowser("Browser"))
+
# OK, now that we know what the default preference orders for each
# platform are, allow user to override them with the BROWSER variable.
if "BROWSER" in os.environ: