I have a PDF with a link to a web page, that used to work (it would open the link in firefox, via xdg-open). However, when I click it now, literally thousands of xdg-open processes are started and plasma-desktop runs at 100% cpu.
I don't know how to start troubleshooting this. What could cause this issue?
An example of a problem PDF is here.
Here is a screenshot of what happens. Note the corrupted taskbar due to thousands of xdg-open instances
I just encountered the same issue, but then for opening a
mailto:
link. The approach to debug the problem is probably similar to yours, however.First, find what handles the mailto (or in your case, http) scheme:
Now, what is
kmailservice5.desktop
?Opening the above file shows:
I wonder what
kmailservice5
does?This is exactly the same output as
xdg-open --help
! That's weird... I looked up the source ofkmailservice5
and found http://api.kde.org/frameworks-api/frameworks5-apidocs/kio/html/kmailservice_8cpp_source.html. It is a simple application that callsQDesktopServices::openUrl
https://doc.qt.io/qt-5/qdesktopservices.html#openUrl (In KDE4, the mail application was explicitly invoked viaKToolInvocation::invokeMailer
; My partial upgrade to KDE5 is probably the reason for this breakage).In other words, mailto:... opens the handler of mailto:, which opens the handler of mailto:, etc. This never ends and the only way to end this loop was to issue
killall kde-open plasma-desktop
.To solve the issue I created a
robs-mailto.desktop
with the following content:and registered it as follows:
and verified that it was correctly registered:
Yes, don't make xdg-open the preferred application. Because the job of xdg-open is to find out the preferred application. Infinite recursion ensues.
In other words, xdg-open is a "client" of the mime/apps preference system. One has to specify somewhere what actually is the preferred application, and that can't possibly be xdg-open itself.
Did you set xdg-open as preferred app for text/html, or was that done by your distro?
It seems the culprit was a bad setting in Dolphin, where the default "open as" action for html files was xdg-open, which I guess caused an infinite loop. After changing the default program to Firefox instead, it works as expected.
I would have thought that having selected Firefox in "System Settings / Default Programs" would have sufficed, but apparently not.