Closed Bug 1940050 Opened 2 months ago Closed 14 days ago

Enable native messaging in Snap

Categories

(Thunderbird :: Add-Ons: General, defect)

Thunderbird 134
defect

Tracking

(Not tracked)

RESOLVED MOVED

People

(Reporter: bugzilla, Assigned: gerard-majax)

References

Details

(Keywords: snap)

Attachments

(3 files)

Steps to reproduce:

Install Thunderbird on Ubuntu via snap
Install KeePassXC and follow the instructions to enable the browser integration on https://github.com/kkapsner/keepassxc-mail/?tab=readme-ov-file#linux
Add the extension keepassxc-mail
Open the error console (Ctrl+Shift+J)

Actual results:

There is a message "No such native application de.kkapsner.keepassxc_mail"

Expected results:

Thunderbird should be able to connect to the native message like Firefox is able to.

Not quite sure if the portal has to be changed as well... (https://github.com/flatpak/xdg-desktop-portal/pull/705)

Component: Untriaged → OS Integration
Keywords: snap
OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Component: OS Integration → Add-Ons: General
OS: Linux → All
Hardware: Desktop → All
See Also: → 1661935

There's still a preference to flip, cf Firefox snap patches

I think there is more to do... setting widget.use-xdg-desktop-portal.native-messaging to 1 or 2 does not work and in https://github.com/canonical/firefox-snap/pull/99/commits/17fa5e9c290c29c43e66aa58d26a2130c20321f0 there seem to be changes in the code of Firefox itself.

Heather, do you know what might be missing on thunderbird side? There's nothing in the patch introducing the feature that obviously looks limited to Firefox itself

Flags: needinfo?(heather)

I am trying to get my head around this. Are the changes linked in Comment 5 or in the canonical firefox snap repo those that are mentioned here by droidmonkey as being "backdoor implemented on their snap"?

Do I understand the following correctly:

  • this change in Firefox snap allows you to use native Messaging on Firefox snap (through the WebExtension portal?) without additional workarounds?
  • flatpack does not work?

(In reply to John Bieling (:TbSync) from comment #7)

I am trying to get my head around this. Are the changes linked in Comment 5 those that are mentioned here by droidmonkey as being "backdoor implemented it on their snap"?

I did read that thread, and I have no idea what "backdoor implemented it on their snap" refers to precisely. There was nothing done hidden, Canonical carried the patch on their snap package, for way too long because it was complicated to land on Gecko, but it was never anything nobody was aware of, we actively worked with them on it as visible here and on phabricator.

Do I understand the following correctly:

  • this change in Firefox snap allows you to use native Messaging on Firefox snap (through the WebExtension portal?) without additional workarounds?

This change is now landed in Gecko, there's no more need for a specific patch for the feature. What remains is just enabling it by default on the Snap. See the review comments on the various patches, I asked whether we could enable it by default but :robwu was not confident it was a good choice until we had a proper end-to-end test of the feature that is done against the real XDG portal and not the mock we are using in those tests.

Adding those tests will be done in https://bugzilla.mozilla.org/show_bug.cgi?id=1928096 and Nathan (from Canonical) is working on it. Nothing hidden.

  • flatpack does not work?

It should work assuming:

  • the pref we flip on snap is flipped for flatpak
  • the xdg document portal used implements the PR.

To the best of my knowledge, upstream XDG PR has not yet been merged, so only Ubuntu (and maybe derivatives) have a XDG portal that implements the bits required for Native Messaging to work

(it's on beta and nightly, coming to stable in a few days, I've already prepared PRs against firefox-snap repo)

On the canonical Firefox snap repo I found this:
https://github.com/canonical/firefox-snap/blob/stable/patches/native-messaging-portal.patch

The Thunderbird snap repo does not have it (I am still waiting for feedback from team members, if that is the actual repo behind https://snapcraft.io/thunderbird):
https://github.com/ubuntu/thunderbird/tree/beta/patches

Do we need to add this patch to Thunderbird snap, or is that patch what is now finally landing in gecko?

Could you link me to resources to understand what the XDG portal is? Is it part of mozilla-central or do users need to install it manually?

(In reply to John Bieling (:TbSync) from comment #10)

On the canonical Firefox snap repo I found this:
https://github.com/canonical/firefox-snap/blob/stable/patches/native-messaging-portal.patch

The Thunderbird snap repo does not have it (I am still waiting for feedback from team members, if that is the actual repo behind https://snapcraft.io/thunderbird):
https://github.com/ubuntu/thunderbird/tree/beta/patches

Do we need to add this patch to Thunderbird snap, or is that patch what is now finally landing in gecko?

Could you link me to resources to understand what the XDG portal is? Is it part of mozilla-central or do users need to install it manually?

You're linking stable branch, please look at beta/nightly it should reply to all your comment.

See also the bug you will find the link to the XDG PR on GitHub, it's part of what is required to run snap or flatpak packages and it's a distro level package

So on the snap Thunderbird beta/nightly you should only need the patch that flips the pref like on Firefox and on stable you still need the complete one. But stable moves next Monday so you should just wait a few more days? Then you'll need only the pref change

That is great news. I just tested on 135.0b4 and after setting widget.use-xdg-desktop-portal.native-messaging to 2 (and restarting Thunderbird) it worked!

(In reply to kkapsner from comment #13)

That is great news. I just tested on 135.0b4 and after setting widget.use-xdg-desktop-portal.native-messaging to 2 (and restarting Thunderbird) it worked!

Ok, so it's working as intended then. Thanks for confirming

(In reply to John Bieling (:TbSync) from comment #10)

The Thunderbird snap repo does not have it (I am still waiting for feedback from team members, if that is the actual repo behind https://snapcraft.io/thunderbird):
https://github.com/ubuntu/thunderbird/tree/beta/patches

I'm not sure what kind of feedback you need here, the feature is needed and it has been baking for a very long time on firefox side, there should be no reason not to have it asap on beta, especially since it's going to arrive on stable very soon.

The XDG PR is https://github.com/flatpak/xdg-desktop-portal/pull/705 but for the snap you should not worry, ubuntu distros have the patches applied so it will work

Flags: needinfo?(john)

Nice. I will get in touch with the responsible peers on our side, and we will follow firefox snap and flip "widget.use-xdg-desktop-portal.native-messaging" on thunderbird snap beta and stable!

Thanks for your patience and your explanations. These are a lot of moving parts....

Flags: needinfo?(john)

Flatpak (beta) seems to work as well on Ubuntu with the flag set.

Assignee: nobody → lissyx+mozillians
Flags: needinfo?(heather)

Thanks, :gerard-majax!

yes thank you very much!!

All PRs were merged

Status: UNCONFIRMED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Resolution: FIXED → MOVED

"Fixed" is reserved for bugs being resolved by code changes in the tree.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: