1

I have got a plugin which is basically an IE equivalent ActiveX control, that supports scripting. I'm using the IDL file & XPCOM Glue in my Plugin - this works fine upto FF 3.5. Apparently as I read from several places that XPCOM support for plugins is gone, but still I'm able to load and embed the plugin in FF3.6 - the problem is I'm not able to access the methods from JS.

I'm now confused whether to re-write my plugin completely(remove the XPCOM glue) or to add NPObject to the same plugin code to make it work. Any sample code for the conversion would help and your guidance would be greatly appreciated.

atVelu
  • 815
  • 1
  • 12
  • 24

1 Answers1

1

You just need to add NPRuntime/NPObject support to make it work.

You could also take the opportunity to rewrite it to use FireBreath so the same code works on both IE and FireFox, but that's up to you =]

Useful blog posts I've written on the subject:

Hope it helps

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Hi Taxilian, Thanks for your suggestion. Could you provide any sample code that will illustrate adding NPObject to the existing XPCOM based code. – atVelu Dec 09 '10 at 19:46
  • err, that's not really a straightforward "example". All of the XPCOM scripting stuff needs to be completely removed and npruntime added in it's place. In other words, the examples that are available in the mozilla codebase and FireBreath all have what you need. You can't keep things half-way; if it's a straight NPAPI plugin you shouldn't have any XPCOM in it anymore at all. – taxilian Dec 30 '10 at 16:54
  • @taxilian I have just build a simple C++ XPCOM extension. Does this mean that I will not be able to run it in the latest Firefox (v.34)? Why do they keep updating the Gecko SDK if they have cut down support for it? Does NPAPI have any future either? Google Chrome seems to start removing NPAPI support. – user2173353 Dec 05 '14 at 15:28
  • FYI: `Binary XPCOM and NPAPI still work in Firefox, but they are both on the way out. The recommended way to access binary code is to use JS ctypes: https://developer.mozilla.org/en-US/docs/Mozilla/js-ctypes.` – user2173353 Dec 08 '14 at 16:26