How to write a browser plugin?

Nathan Osman picture Nathan Osman · Apr 15, 2010 · Viewed 31.7k times · Source

I'm curious as to the procedure for writing browser plugins for browsers like Chrome, Safari, and Opera. I'm thinking specifically of Windows here and would prefer working with C++.

Are there any tools or tutorials that detail the process?

Note: I am not referring to extensions or 'addons'. I'm referring to a plugin similar to how Flash and Adobe Reader have plugins to handle specific content-types.

Answer

Georg Fritzsche picture Georg Fritzsche · Sep 23, 2010

As others point out, plugins for those browser are written using the NPAPI.

Note: Both Firefox and Chrome will default most plugins to click-to-play soon, with Chrome planning to phase out NPAPI entirely. NPAPI for new projects is discouraged at this point.

Resources for getting started with NPAPI:

The NPAPI itself is however relatively low-level, but there are tools and frameworks that can help you with it:

  • FireBreath - cross-browser, cross-platform frame-work for plugins
  • Nixysa - generate glue-code for NPAPI plugins
  • JUCE - application framework also providing support for plugins
  • QtBrowserPlugin - Qt based browser plugin framework