Commit db6f0aa6 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Windows: Open uris with webbrowser lib

Trying to work around #10455
parent 2bef238b
......@@ -47,6 +47,7 @@ import random
import weakref
import inspect
import string
import webbrowser
from string import Template
import urllib
from urllib.parse import unquote
......@@ -1099,13 +1100,22 @@ def open_uri(uri, account=None):
open_file(uri.data)
elif uri.type == URIType.TEL:
Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}')
if sys.platform == 'win32':
webbrowser.open(f'tel:{uri.data}')
else:
Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}')
elif uri.type == URIType.MAIL:
Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}')
if sys.platform == 'win32':
webbrowser.open(f'mailto:{uri.data}')
else:
Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}')
elif uri.type in (URIType.WEB, URIType.GEO):
Gio.AppInfo.launch_default_for_uri(uri.data)
if sys.platform == 'win32':
webbrowser.open(uri.data)
else:
Gio.AppInfo.launch_default_for_uri(uri.data)
elif uri.type == URIType.AT:
app.interface.new_chat_from_jid(account, uri.data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment