Open HTTP(S) links in the system browser.
This commit is contained in:
parent
0fdf9ac473
commit
c0f4c8eae4
6
av98.py
6
av98.py
|
@ -28,6 +28,7 @@ import urllib.parse
|
||||||
import ssl
|
import ssl
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
_MAX_REDIRECTS = 5
|
_MAX_REDIRECTS = 5
|
||||||
|
|
||||||
|
@ -230,7 +231,10 @@ class GeminiClient(cmd.Cmd):
|
||||||
its a menu, storing the response in a temporary file, choosing
|
its a menu, storing the response in a temporary file, choosing
|
||||||
and calling a handler program, and updating the history."""
|
and calling a handler program, and updating the history."""
|
||||||
# Don't try to speak to servers running other protocols
|
# Don't try to speak to servers running other protocols
|
||||||
if gi.scheme not in ("gemini", "gopher"):
|
if gi.scheme in ("http", "https"):
|
||||||
|
webbrowser.open_new_tab(gi.url)
|
||||||
|
return
|
||||||
|
elif gi.scheme not in ("gemini", "gopher"):
|
||||||
print("Sorry, no support for " + gi.scheme)
|
print("Sorry, no support for " + gi.scheme)
|
||||||
return
|
return
|
||||||
# Obey permanent redirects
|
# Obey permanent redirects
|
||||||
|
|
Loading…
Reference in New Issue