Bug 403499 - Opening URLs doesn't respect mimeapps.list and is buggy
Summary: Opening URLs doesn't respect mimeapps.list and is buggy
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-22 12:41 UTC by Martin
Modified: 2020-01-21 13:29 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2019-01-22 12:41:03 UTC
SUMMARY
KDE ignores mimeapps.list for launching URLs and can't get https://google.com opened by default.

STEPS TO REPRODUCE
1. ~/.config/mimeapps.list should contain
[Added Associations]
text/html=firefox.desktop;

2. Try opening https://google.com by clicking on it somewhere (I used Telegram)
3. Error: 'A folder named /home/c0rn3j/.cache/kioexec/krun/8344_0/ already exists.'

2. Try opening https://github.com/Lyrics/lyrics.github.io/issues/15 by clicking on it somewhere
3. It tries to open in Calibre. Why?

There's no way to make KDE just use the XDG defaults as far as I am aware, it just tries to open it in whatever app it finds suitable, and can't even open https://google.com 
https://i.imgur.com/7AAULL5.png

OBSERVED RESULT
Be able to open https://google.com with default settings
Have KDE respect mimeapps.list for default browser by default, at the very least have it as an option

EXPECTED RESULT
Can't open https://google.com - kio error
Can't get any URL to open in Firefox. It's either an error or Calibre.



SOFTWARE/OS VERSIONS
OS: Arch Linux
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION

The selected product is my best guess.
Comment 1 Jan Grulich 2019-01-22 13:23:58 UTC
Are we talking about opening URLs from Flatpak/Snap applications?
Comment 2 Martin 2019-01-22 15:12:40 UTC
No, I have Telegram installed as a normal system app through pacman.

It looks like KDE adds definitions into ~/.config/mimeapps.list when you select a hardcoded app to open URLs in, and does not remove when switching back to the default option, so reproducing this without deleting them manually is probably impossible.

With the definitions everything works just fine:

[Default Applications]
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
Comment 3 Jan Grulich 2019-01-22 15:20:46 UTC
In that case it's not xdg-desktop-portal-kde issue, but probably KRun?
Comment 4 Nate Graham 2019-02-06 04:56:17 UTC
Yep, it's in KRun. Here, have a patch: https://phabricator.kde.org/D18778
Comment 5 Ahmad Samir 2019-09-15 17:13:09 UTC
This looks like a configuration issue. Most distros set a web browser (you can check in the componentchooser kcm) to open http and https links.

Can you reproduce this issue with a new user account?
Comment 6 Méven Car 2020-01-21 13:29:12 UTC
text/html is the mimetype for html files

x-scheme-handler/http is the "meta" mimetype that designate an application to open an "http://" url.
So that is what you need to setup a browser.

Also when manually editing mimeapps.list rather than using kcmshell5 componentchooser, you will need to run kbuildsycoca5 and kdeinit5 to refresh the configuration cache (or close the session).

I think this is not really a bug.