Is it possible to use a .dll made with Firebreath in a Firefox extension?
Currently, I am trying to port an extension I made for Google Chrome that uses javascript to get the HTML of the document, and then calls a function from the .dll and passes the HTML of the document as a parameter. The .dll then saves the file and launches a program.
Is there a simple way to port this functionality over to Firefox? Or will I have to rewrite the code using XPCOM?
XPCOM is too complicated for simple things which is why Firefox 4 and above has js-ctypes (see https://developer.mozilla.org/en/js-ctypes for an overview and https://developer.mozilla.org/en/js-ctypes/Using_js-ctypes#Calling_Windows_routines for an example). This allows you to load the DLL and call an exported native function easily. If you really need to use this DLL as an NPAPI plugin things get more complicated because you need a window to load the plugin into and Firefox unlike Chrome doesn't have a dedicated background window for that. But I guess that you only turned your DLL into a plugin to be able to use it in Chrome.
On locating your DLL to use with ctypes.open() see my answer here: Reference a binary-component to js-ctypes
For simple functionality, I also recommend js-ctypes. It is easy to use and provides good isolation (since scripts on the page cannot access the imported library).
If you really need to access an NPAPI plugin from any page, the standard approach seems to be to create an extension and modify the DOM of each page to include the plugin:
Scriptable NPAPI plugin doesn't work with Firefox
yes you can use a firebreath dll as an firefox extension. you can use the same javascript with some modifications for Firefox and for HTML you have to use XUL. You have to load the script in a XUL that overlays default firfox's
browser.xul
Inside Youroverlay.xul, you can add the below line to embed Firebreath dll