Using a plugin generated with Firebreath in a Firefox Extension?

前端 未结 3 962
既然无缘
既然无缘 2020-12-20 02:24

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

3条回答
  •  失恋的感觉
    2020-12-20 02:59

    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

提交回复
热议问题