A simple hello world NPAPI plugin for Google Chrome?
Asked Answered
T

2

16

I am trying to make a chrome plugin but Chrome API doesn't give me enough power. I want to use NPAPI but I have no idea how to use it but I do have experience in Visual C++.

Can someone show me a 'Hello world' in C++ application so I can get started?

Theressa answered 16/4, 2010 at 10:1 Comment(0)
L
24

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.

NPAPI plugins shouldn't be browser specific (at least as far as possible). Seamonkeys npruntime sample can be considered a basic Hello World for NPAPI. If you care about up-to-date Mac support, you need to take a look at WebKits or Apples samples.

Reading material to get you started:

There is also the FireBreath project: It is a framework aiming at lowering the entry barrier to browser plugin development and already takes care of most common tasks and issues.

Lucerne answered 16/4, 2010 at 22:32 Comment(8)
I also recommend reading a book "Programming Netscape Plug-Ins" by Zan Oliphant podgoretsky.pri.ee/ftp/Docs/Internet/Netscape%20Plug-InsButtock
Keep in mind that as of 09/23/13, Chrome is phasing out support for NPAPI based solutions. blog.chromium.org/2013/09/…Reface
... and Firefox will make all plugins except Flash click-to-play a month before Chrome.Lucerne
what is replacing npapiBeechnut
@Techsin: Ideally Web APIs - many capabilities were added to the web platform recently, especially motivated by the different situation on mobile.Lucerne
This is misleading and false: NPAPI is not being discouraged to be used – only Google Chrome dropped its support. Firefox doesn't have any plans to remove its support at all, all they did is making the plugins click-to-play. NPAPI is still the right way to write plugins for Firefox in C or C++. Chrome moved to its own API called NaCl – and that's the new way to write plugins in C or C++ for Chrome. IMHO what Chrome did is downright stupid.Bael
@Zupoman: This is not misleading nor false. NPAPI is on its way out for Firefox too, just slower. We already default most plugins to click-to-play, long term NPAPI is at question. The WIP 64bit builds already cut support for most plugins.Lucerne
@GeorgFritzsche this: support.mozilla.org/pl/questions/972191 and this: support.mozilla.org/pl/questions/974299 clearly say that they aren't going to drop NPAPI support. Also as far as I know there is no real alternative to NPAPI in Firefox for plugins written in C/C++.Bael
S
7

Here is a simple cross platform example: npsimple

Secondrate answered 16/4, 2010 at 22:58 Comment(3)
Visual Studio solution release is for Smartphone? Also, getting the dependencies (npapi headers) is required, they are not inside the repository. Usually hunting the compilation dependencies in Windows sucks the most.Lacy
Turns out the headers can be found from rather obscure google-code SVN code.google.com/p/npapi-headersLacy
It's the npapi-sdk project now. This pull request seems to update npsimple to it.Lucerne

© 2022 - 2024 — McMap. All rights reserved.