There is a bug[1] preventing bookmarklets from working correctly in Firefox. To work around this bug, it is possible to use extensions, which can execute all (including potentially unsafe) browser code. One option is to use the "Custom buttons" extension[2] and create custom buttons which execute your Javascript code.

My example case: In my .keysnailrc I have this function:

ext.add("bookmark-with-org",
        function (aEvent, aArg) {
          var od = window.content.document;
          window.loadURI('org-protocol://capture://f/'+encodeURIComponent(od.location.href)+'/'+encodeURIComponent(od.title)+'/'+encodeURIComponent(window.content.getSelection()));
}, M({en: "Save bookmark in Emacs org-mode using org-protocol"}));

Running the function sends a bookmark to Emacs org-mode capture.

To call the function from a custom button, I use this code:

window.KeySnail.modules.ext.exec("bookmark-with-org",null);

References

[1] 866522 – bookmarklets affected by CSP. [ bib | http ]
[2] Custom buttons :: Add-ons for firefox. [ bib | http ]