Skip to content

Commit 90f7574

Browse files
committed
webbrowser: add kioclient support
1 parent 72bd9a4 commit 90f7574

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Doc/library/webbrowser.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ Notes:
205205

206206
.. versionadded:: next
207207
Support for launching the XDG default browser via ``gtk-launch`` or ``gio launch`` on POSIX systems,
208-
and ``exo-open`` in XFCE environments.
208+
``exo-open`` in XFCE environments,
209+
and ``kioclient exec`` in KDE environments.
209210

210211
.. versionchanged:: next
211212
``file://`` URLs should now open more reliably in browsers on all platforms,

Lib/webbrowser.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,12 @@ def register_X_browsers():
501501

502502
# The default KDE browser
503503
if (("KDE" in xdg_desktop or
504-
"KDE_FULL_SESSION" in os.environ) and
505-
shutil.which("kfmclient")):
506-
register("kfmclient", Konqueror, Konqueror("kfmclient"))
504+
"KDE_FULL_SESSION" in os.environ):
505+
if shutil.which("kioclient"):
506+
# launch URL with http[s] handler
507+
register("kioclient", None, BackgroundBrowser(["kioclient", "exec", "%s", "x-scheme-handler/https"]))
508+
if shutil.which("kfmclient")):
509+
register("kfmclient", Konqueror, Konqueror("kfmclient"))
507510

508511
# The default XFCE browser
509512
if "XFCE" in xdg_desktop and shutil.which("exo-open"):

0 commit comments

Comments
 (0)