8000 gh-128540: launch default browser more often on Linux by minrk · Pull Request #130541 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128540: launch default browser more often on Linux #130541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
webbrowser: add kioclient support
  • Loading branch information
minrk committed Feb 27, 2025
commit 90f75747ecc1de955c20d61c4401b12ef2880f39
3 changes: 2 additions & 1 deletion Doc/library/webbrowser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ Notes:

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

.. versionchanged:: next
``file://`` URLs should now open more reliably in browsers on all platforms,
Expand Down
9 changes: 6 additions & 3 deletions Lib/webbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,12 @@ def register_X_browsers():

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

# The default XFCE browser
if "XFCE" in xdg_desktop and shutil.which("exo-open"):
Expand Down
0