For an electronic prescription system, that runs on the browser and that requieres personal signature by the professional, we are using a Java applet to sign the XML request
We faced the same problem, came up with a solution (native messaging, yes)
https://github.com/open-eid/chrome-token-signing