Firefox (librewolf) behaves differently when opening a URI compared with xdg-query

Hi there,

I’m trying to use the org-capture extension with Librewolf (although I had the exact same issue in vanilla Firefox as well), but the URI handler does not behave the same way as xdg-open does on the same URI.

With debug logging on the org-capture extension turned on, I can see that org-capture builds and then calls the following URI:

org-protocol://capture?template=L&url=https%3A%2F%2Fdiscourse.nixos.org%2F&title=NixOS%20Discourse%20-%20NixOS%20community%20forum&body=

But what happens is that a new emacsclient instance is opened, and the capture isn’t received. It just triggers a new emacsclient frame to open.

However, when I copy the above URI and trigger it with xdg-open like so:

xdg-open 'org-protocol://capture?template=L&url=https%3A%2F%2Fdiscourse.nixos.org%2F&title=NixOS%20Discourse%20-%20NixOS%20community%20forum&body='

Then an existing emacsclient instance is used, and the capture is received as expected.

How do I ensure the Librewolf package & service has the ability to call these org-protocol URIs correctly?