I tried enabling native KDE dialog integration with Firefox using xdg-desktop-portal-kde, and noticed that Firefox keeps asking about being set as default browser on each startup. I installed: xdg-desktop-portal 1.0.3 xdg-desktop-portal-kde 5.14.3 Set in $HOME/.profile: export GTK_USE_PORTAL=1 Applications > Default Applications > Web Browser already set to Firefox. When GTK_USE_PORTAL is not set, it's not asking after first time. I also noticed, that Firefox normally remembers this setting after creating a NoDisplay .desktop file in $HOME/.local/share/applications Such as: $HOME/.local/share/applications/userapp-Firefox-IIJAUZ.desktop [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application NoDisplay=true Exec=/opt/mozilla/firefox/firefox-bin %u Name=Firefox Comment=Custom definition for Firefox This is not visible in menu and not available to System Settings choice (because of NoDisplay=true), so I usually create another .desktop file there, to expose Firefox. Something like: $HOME/.local/share/applications/Firefox.desktop [Desktop Entry] Comment= Exec=/opt/mozilla/firefox/firefox %u GenericName=Mozilla Firefox Icon=/home/user/pictures/icons/firefox.png MimeType=application/x-www-browser; Name=Firefox NoDisplay=false StartupNotify=false Terminal=false TerminalOptions= Type=Application X-KDE-SubstituteUID=false X-KDE-Username= Categories=Network;WebBrowser; This way it can be selected in System Settings > Applications > Default Applications > Web Browser. Something between these two and xdg desktop portal goes wrong I suppose.
To clarify the above. Without GTK_USE_PORTAL=1, Firefox remembers "default browser" setting by creating a NoDisplay .desktop file. Even with that file present, it's still asking when GTK_USE_PORTAL=1 is set.
I don't think this has something to do with our portal implementation. I think the problem here is that with GTK_USE_PORTAL=1 Firefox probably thinks it's running in sandbox and tries to read the configuration in a different way or on a different place, no idea.
I can file a Mozilla bug if you think that's something on the Firefox side.
Opened Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516290
Comment by Jan Horak: https://bugzilla.mozilla.org/show_bug.cgi?id=1516290#c9 > Setting GTK_USER_PORTAL=1 to get KDE native dialog is generally not a good > idea. The GTK_USER_PORTAL variable is used to detect if the app runs as a > flatpak and that means it cannot use the native print dialog and look for > mimetype handlers in Firefox.