Open Bug 1805440 Opened 2 years ago Updated 1 year ago

No GNOME Shell search provider in Flatpak build

Categories

(Core :: Widget: Gtk, enhancement)

Desktop
Linux
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: will, Unassigned)

References

(Blocks 1 open bug)

Details

From #1804659 I learned that Firefox contains an implementation of a GNOME Shell search provider! However this is not available in the Flatpak version, for a number of reasons.

Firstly, the search-provider.ini file is not shipped as part of the Flatpak. It should be installed to /app/share/gnome-shell/search-providers/org.mozilla.firefox.search-provider.ini. (The prefix on the basename must match the app ID, org.mozilla.firefox, for Flatpak to export it to the system.)

Secondly, the contents of the file need to look a bit different:

[Shell Search Provider]
DesktopId=firefox.desktop
BusName=org.mozilla.Firefox.SearchProvider
ObjectPath=/org/mozilla/Firefox/SearchProvider
Version=2

The DesktopId must be adjusted to match the desktop file exported by the flatpak:

DesktopId=org.mozilla.firefox.desktop

And unfortunately the BusName and ObjectPath specified here and in the code begins with org.mozilla.Firefox. However the app ID in Flatpak land is org.mozilla.firefox, lowercase f, and these app IDs are case-sensitive. (As I recall the lowercase form was preferred by Mozilla when the app was first added to Flathub for consistency with other platforms. Oops!) So this needs to change to the lowercase form.

Even with these two changes, it's not clear to me whether the relevant code is actually compiled into the binary that is uploaded to Flathub. If I run the app with --own-name=org.mozilla.Firefox.SearchProvider

If I run the app with --own-name=org.mozilla.Firefox.SearchProvider

I hit Enter too soon.

If I run the app with flatpak run --own-name=org.mozilla.Firefox.SearchProvider org.mozilla.firefox to work around the case-sensitivity, it does not actually take ownership of that name.

Blocks: flatpak
Duplicate of this bug: 1702618
Depends on: 1835135
  1. bug 1835135
  2. Try adding the following file after this line.
cat <<EOF > org.mozilla.firefox.search-provider.ini
[Shell Search Provider]
DesktopId=org.mozilla.firefox.desktop
BusName=org.mozilla.firefox.SearchProvider
ObjectPath=/org/mozilla/firefox/SearchProvider
Version=2
EOF
  1. Try adding the following after this line:
    install -D -m644 -t "${appdir}/share/gnome-shell/search-providers" org.mozilla.firefox.search-provider.ini

because there is
https://github.com/flatpak/flatpak/blob/4c6136ab2146234bff37925b218026de846d584e/common/flatpak-utils.c#L793

strcmp (source_path, "share/gnome-shell/search-providers") == 0)

strcmp (source_path, "share/appdata") == 0)

and the flatpak already contains
install -D -m644 -t "${appdir}/share/appdata" org.mozilla.firefox.appdata.xml

  1. Add pref("browser.gnome-search-provider.enabled", true); to https://searchfox.org/mozilla-central/source/taskcluster/docker/firefox-flatpak/default-preferences.js
You need to log in before you can comment on or make changes to this bug.