0

I saw that one can call the c++ code from JavaScript like this: Calling C++ Code from DHTML

But it is for IE,i use NPAPI to implement a plugin for firefox,and i want to call the method which is defined in c++ code via html file,how can i get it?

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
  • As far as I understand the article, it is only applicable when using an IE control *within your application*. Your case is completely different – you have to have a look at the documentation of the Firefox interface for plugins. – Konrad Rudolph Apr 07 '13 at 10:23

1 Answers1

1

You may want to take a look at FireBreath. That's by far the easiest tool for building a plugin to do what you want. Barring that, there are tutorials you can read to learn about building an NPAPI plugin from scratch, though it's a bit of a pain.

There is also nixysa, though i've never used it myself.

However you do it (and I strongly recommend FireBreath, since once you have the tools needed to use it you can get a new plugin up in literally 30 minutes or less) you need to expose a scriptable object to the page. If you're using NPAPI directly that means providing an NPObject (discussed in tutorial part 3) that the page will be able to access.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Thank for your answer again,taxilian.you exsit everywhere.In my eyes,the firebreath is more pain than npapi.For ,I have no idear on how to get the handle of the window,how to create a window with the method like "CreateWindowEx",and what's more,how to get the interaction between html and cpp file.er,the tutials about firebreath is hard to find,i'm confused now. – user2214914 Apr 08 '13 at 03:39
  • So ask specific questions about how to do those things; however, you'll find most of the answers to those questions on the Getting Started sections of the website. Next check the tips and tricks section, look at http://colonelpanic.net/2010/11/firebreath-tips-drawing-on-windows/, and if all else fails you can always try the google group or http://npapi.com/chat, both of which I monitor as best I can. I wrote FireBreath, btw. – taxilian Apr 08 '13 at 03:54