Reputation: 169
it can look like a very simple question, but as a JS beginner, I would like to know if it was possible to use a NodeJS module (I would like to use this one for exemple : https://github.com/yaronn/xml-crypto) in a webextension without having to change it's code.
Thanks in advance.
Upvotes: 2
Views: 820
Reputation: 24406
I am the author of xml-crypto. xml-crypto is built for node.js and relies on the node.js crypto built in module which is not available for browsers. However there is an alternative browser crypto module called forge. Someone told me they were able to replace xml-crypto dependency in crypto with forge (by making small code changes in xml-crypyo) and that allows to run xml-crypto in a browser. You would also need to use browserify which should be easy here.
Upvotes: 2