Today, I found out that it’s possible to use KDE filechooser in Firefox and other GTK applications thanks to the xdg-desktop-portal project.

To take advantage of this, make sure xdg-desktop-portal-kde is running (Starts automatically on Kubuntu. You should be able to run it manually if KDE is installed). Set the environment variable GTK_USE_PORTAL=1, for instance by appending export GTK_USE_PORTAL=1 to your ~/.profile. Since Firefox 98, you can also set Firefox to explicitly use xdg-desktop-portal through the configuration parameters under widget.use-xdg-desktop-portal.* (set them to 1 to always use the portal).

Firefox portal configuration:

Firefox configuration parameters under widget.use-xdg-desktop-portal set to 1

Old, GTK filechooser:

GTK filechooser, the abomination

New, KDE filechooser, with image previews and other basic usability features:

KDE filechooser, the our savior

Life has been improved ✅