Ubuntu – How to use KDE global menu with Firefox

firefoxglobalmenukde5plasma-5

I would like Firefox to use the global menu on KDE Plasma 5.19 running on X11.

  • The widget set for both GTK and KDE is Breeze.
  • I am currently using Kubuntu 20.10, but also have machines running 18.04 and 20.04. Global menu does work on 18.04, but not 20.04 or 20.10.
  • Existing questions on the topic are outdated, mostly related to issues with appmenu on Unity.

The global menu has never worked for me with Firefox. The global menu does work with other applications that have menus.

  • GTK2: xournal
  • GTK3: geany, geeqie
  • KDE: Falkon, Konsole
  • Others: Google Chrome, LibreOffice

The following potentially relevant services are running:

  • Application menus daemon
  • GNOME/GTK Settings Synchronization Service

The following do not work:

  • plasma-browser-integration package and associated add-on.

  • xdg-desktop-portal-* packages.

  • Wayland. The global menu of GTK apps do not work in Wayland. Wayland also has too many other defects.

  • Restarting Firefox with a fresh profile.

  • Installing the following packages. Most of them were not necessary for other applications to use the global menu.

    appmenu-gtk2-module appmenu-gtk3-module appmenu-gtk-module-common appmenu-registrar gir1.2-dbusmenu-glib-0.4 gir1.2-dbusmenu-gtk-0.4 gir1.2-dbusmenu-gtk3-0.4 indicator-appmenu indicator-appmenu-tools libappindicator1 libappindicator3-1 libappmenu-gtk2-parser0 libappmenu-gtk3-parser0 libdbusmenu-glib4 libdbusmenu-gtk3-4 libdbusmenu-gtk4 libdbusmenu-qt5-2 libdbusmenu-tools libindicator3-7 libindicator3-tools libindicator7

What needs to be done to get Firefox to use the global menus?

Best Answer

To use the global menu with Firefox currently requires a patch. Archisman Panigrahi explains:

Global menu used to work with Firefox in KDE Neon 18.04 (and probably Kubuntu 18.04 as well), because (as far as I know) Ubuntu developers used [to] patch it for compatibility with Unity (which also had global menu). As Unity was dropped, the patch was discontinued

Specifically, the patch exports the menu via dbus. Without it, Firefox does not export the menu, so other applications can't access it. No global menu.

The current options:

  • Use the method described in this answer to install the latest version of firefox from repository of Ubuntu 18.04. You don't need to use apt-mark or find updates manually (unlike the next bullet point) if you use this method.

In this method, you would receive firefox updates normally as you did before (at least, until 18.04 is supported).

Results global menu in action

  • Find and use patched binaries. Firefox in 18.04 repositories continue to apply the menu patch. There are other patched and renamed versions of Firefox, but they should probably be avoided for various reasons. You can prevent the package from upgrading to an unpatched version with sudo apt-mark hold firefox.

  • Recompile the source with the patch. This is the "safest" option. A minimal development toolset can be installed to upload the source to launchpad.net for compilation and inclusion in a PPA.

  • Live without Firefox global menus, and hope they're eventually implemented upstream. (Is there anything in the menu that you really need?)

See also:

Related Question