SUMMARY When clicking a link in a Qt/KDE app on Plasma, the website is downloaded to a cache directory (~/.cache/kioexec/krun/) and the local file will be opened in the default browser, rather than the link being forwarded to the browser. This causes many issues: - The file is usually displayed as text, not as website - When recognised as html, images and cross-references to other pages don't work; the website looks damaged - The cache is never cleaned by the system; the unnecessary files remain. The directory will grow enormously unless users take action. Links in programs occur very often: In PDFs, in About and Help windows, in markdown preview, and many many more places. Usually, links can be copy/pasted manually into the browser, avoiding the cache. However, sometimes they are not copyable, so there is no possibility to avoid the cache. (For some links, I never found out which websites they were actually pointing to, because the text content didn't tell.) Websites should never get downloaded and cached, but the links should simply be sent to the browser, like GTK applications such as Thunderbird do. STEPS TO REPRODUCE 1. Open any Qt/KDE app containing a web link (e. g. Kate -> Help -> About Kate -> Link to the Kate website) 2. Click it OBSERVED RESULT - The website will get downloaded to ~/.cache/kioexec/krun/ (a KIO notification with progress bar shows up) - The default browser will open the file, usually displayed as plain text - The file will remain across sessions and restarts, unless deleted manually EXPECTED RESULT - The link should be sent to the browser without caching. - The website should load as html, not as text. - All content should look correct; cross-references should work. SOFTWARE/OS VERSIONS Operating System: KDE neon 5.22 KDE Plasma Version: 5.22.2 KDE Frameworks Version: 5.83.0 Qt Version: 5.15.3 Kernel Version: 5.8.0-59-generic (64-bit) Graphics Platform: Wayland ADDITIONAL INFORMATION This didn't happen at the time of Plasma 5.20. Related: - https://bugs.kde.org/show_bug.cgi?id=413885 - https://askubuntu.com/questions/1186697/what-uses-and-fills-up-cache-kioexec-krun WORKAROUND Save the following Python code to any place you like, make it executable (chmod +x $FILENAME), and define it as logout script to clean the cache directory regularly. ``` #! /usr/bin/env python3 import os import shutil HOME = os.path.expanduser('~') KIO_CACHE = HOME+'/.cache/kioexec/krun/' def clean_kiocache(): for file_or_dir in os.listdir(KIO_CACHE): cached = KIO_CACHE+file_or_dir if os.path.isdir(cached): shutil.rmtree(cached) else: os.remove(cached) if __name__ == '__main__': clean_kiocache() ``` (A normal shell script might have been shorter.)
Created attachment 139847 [details] Screenshot illustrating the problem
Do you have a default web browser set in systemsettings -> applications -> default applications?
.
Of course I do. It's Chromium.
I think this can't be the problem. The default browser is recognised properly, as the cached file is opened in it. Was the description unclear?
Looking at https://invent.kde.org/frameworks/kio/-/merge_requests/498 could you check the .desktop file used? (is it the one shipped by chromium or did you select the chromium executable from the open-with dialog in the "default applications" KCM?
I think I did selected from the open-with dialog of the kcm, so the linked PR is likely to fix the problem. Thanks in advance!
Excellent, thanks for feedback :)
By the way, may I ask why the permanent cache ~/.cache/kioexec/krun/ exists at all? Wouldn't regular tempfiles that are removed at the end of a session make more sense?
(In reply to Manuel Geißer from comment #9) > By the way, may I ask why the permanent cache ~/.cache/kioexec/krun/ exists > at all? Wouldn't regular tempfiles that are removed at the end of a session > make more sense? That's a good point, could you open a bug report to track that issue? :)
Yeah, I'll do that.
https://bugs.kde.org/show_bug.cgi?id=439886
Unfortunately, this bug got back with kf5 updates. It was fixed for some time, but now I have the same problem again.
I can confirm that this bug can be reproduced by removing "%u" in the exec line from the `firefox.desktop` file. I was changing that line to enforce some settings, and I thought %u is useless "bureaucracy". Appending %u back to that line solved the problem for me. I am on using KDE from archlinux's unstable repo. Operating System: Arch Linux KDE Plasma Version: 5.23.90 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2
I wanted to comment. I started having this issue recently.
(In reply to ziesv4tii from comment #15) > I wanted to comment. I started having this issue recently. Looking at comment#14, that could be a misconfiguration issue; could you post the contents of the actual .desktop file being used? mostly likely it's in: - /usr/share/applications/ OR - /usr/local/share/applications/ OR - ~/.local/share/applications with the last one taking precedence.
Created attachment 156535 [details] /usr/share/applications/
Created attachment 156536 [details] ~/.local/share/applications
Also got this issue recently, it downloads urls instead opening in web browser. example open kate in terminal > about > click url kate command= "/usr/bin/brave-beta --use-gl=desktop --enable-features=VaapiVideoDecoder --disable-features=UseChromeOSDirectVideoDecoder" args= ("/usr/bin/brave-beta --use-gl=desktop --enable-features=VaapiVideoDecoder --disable-features=UseChromeOSDirectVideoDecoder", "https://kate-editor.org") kf.kio.core: Protocol Class of url QUrl("https://kate-editor.org") , isn't ':local', cancelling job. Copying QUrl("https://kate-editor.org") to QUrl("file:///home/rob/.cache/kioexec/krun/15485_0/unnamed") All files downloaded, will call slotRunApp shortly No files downloaded -> exiting A KUiServerV2JobTracker instance contains 1 stalled jobs
Affected for a long long time. Gentoo.
As https://bugs.kde.org/show_bug.cgi?id=439477#c14 already found out this thing happens when the relevant .desktop file is missing the %u placeholder. This can be either because upstream does not include it or it was manually removed
*** Bug 479580 has been marked as a duplicate of this bug. ***
Hello, I am having this same problem using the Viber app (a messaging app). https://www.viber.com/en/download/ Operating System: Kubuntu 23.10 KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 When I click on a link it will give the following debug message. Maybe it can point to the issue or workaround. ``` command= "env GTK_USE_PORTAL=1 /usr/bin/google-chrome-stable" args= ("env GTK_USE_PORTAL=1 /usr/bin/google-chrome-stable", "https://www.yahoo.com/") kf.kio.core: Protocol Class of url QUrl("https://www.yahoo.com/") , isn't ':local', cancelling job. Copying QUrl("https://www.yahoo.com/") to QUrl("file:///home/user1/.cache/kioexec/krun/42229_0/unnamed") Telling kioexecd to watch path "/home/user1/.cache/kioexec/krun/42229_0/unnamed" dest "https://www.yahoo.com/" All files downloaded, will call slotRunApp shortly EXEC "/usr/bin/env GTK_USE_PORTAL=1 /usr/bin/google-chrome-stable /home/user1/.cache/kioexec/krun/42229_0/unnamed" mkdir: /tmp/.mount_viber.jKTZis/usr/lib/libselinux.so.1: no version information available (required by mkdir) /usr/bin/google-chrome-stable: /tmp/.mount_viber.jKTZis/usr/lib/libnss3.so: version `NSS_3.65' not found (required by /lib/x86_64-linux-gnu/libsmime3.so) EXEC done ```
In addition this is my viber.desktop application file. [Desktop Entry] Categories=Network;InstantMessaging;P2P; Comment[en_US]=Viber VoIP and messenger Comment=Viber VoIP and messenger Exec=/home/user1/Applications/viber.appimage %u GenericName[en_US]= GenericName= Icon=Viber MimeType= Name[en_US]=Viber Name=Viber Path= StartupNotify=true Terminal=false TerminalOptions= Type=Application X-DBUS-ServiceName= X-DBUS-StartupType= X-KDE-SubstituteUID=false X-KDE-Username=
Make sure the *Chrome* desktop file contains the %u placeholder
(In reply to Nicolas Fella from comment #25) > Make sure the *Chrome* desktop file contains the %u placeholder Did try it and even other browsers. However I tried executing the above EXEC command from the command line, and I get the page raw text. But if I rename 'unnamed' to 'unnamed.html' it works fine: /usr/bin/env GTK_USE_PORTAL=1 /usr/bin/google-chrome-stable /home/user1/.cache/kioexec/krun/42229_0/unnamed vs after renaming /usr/bin/env GTK_USE_PORTAL=1 /usr/bin/google-chrome-stable /home/user1/.cache/kioexec/krun/42229_0/unnamed.html So it seems to me it has to do with the mimetype? Not sure why the page is being saved in cache with that name anyway. Also is this error related: mkdir: /tmp/.mount_viber.jKTZis/usr/lib/libselinux.so.1: no version information available (required by mkdir) /usr/bin/google-chrome-stable: /tmp/.mount_viber.jKTZis/usr/lib/libnss3.so: version `NSS_3.65' not found (required by /lib/x86_64-linux-gnu/libsmime3.so)