Firefox is an excellent browser with many useful and innovative features that is created by an organization that respects and strives to protect its users' privacy. It is also a GTK based application which means that it will use GTK elements in dialog windows for browsing files to upload to a website or to save files to the computer from a website. Plasma users would prefer to have native Qt/KDE Frameworks based file dialog windows.
Unfortunately, no distribution except openSUSE provides a modified version of a Firefox package that uses native Plasma file dialogs. This article describes a procedure to make the needed modification ourselves.
Firefox being a GTK based program uses GTK resources in displaying a file dialog, something that is limiting to Plasma users that value all of the features that Qt/KDE Frameworks provides in its file dialog. Fortunately it is possible to easily modify this behavior by using xdg-desktop-portal and its KDE specific auxiliary xdg-desktop-portal-kde and launching Firefox with a specific environment variable.
openSUSE describes its xdg-desktop-portal as:
A portal frontend service for Flatpak and possibly other desktop containment frameworks. xdg-desktop-portal works by exposing a series of D-Bus interfaces known as portals under a well-known name (org.freedesktop.portal.Desktop) and object path (/org/freedesktop/portal/desktop). The portal interfaces include APIs for file access, opening URIs, printing and others.
Before describing the procedure, two sets of screenshots are displayed below that illustrate the difference between the Firefox file dialog without the modification.
The screenshots above depict the file dialog opened by Firefox without the modification.
The screenshots above depict the file dialog opened by Firefox with the modification.
1. Replace the line
Exec=GTK_USE_PORTAL=1 /usr/lib/firefox/firefox %u
Exec=GTK_USE_PORTAL=1 firefox-beta -P beta %u
Exec=GTK_USE_PORTAL=1 firefox-developer-edition -P developer-edition %u
The desktop file before the modification is shown in the next screenshot.
The desktop file after the modification is shown in the next screenshot.
No distribution I have tried except openSUSE, even those that are specifically Plasma focused or provide a Plasma based edition, such as Fedora KDE Spin or Kubuntu, provide a Firefox package that uses a native Plasma filed dialog. Fortunately, it is simple for end users to make the necessary modifications.