Npapi Firefox plugin VS2013 Development example
Below is a demo that I have done on my own, and provide code downloads based on the online development sample.
Development environment
Windows 8.1 x64 Visual Studio 2013
Preparatory work
First need to download from the official website Firefox source (also can download other versions), there is the development of plug-in required header files.
Official website:, http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/33.0/source/firefox-33.0.source.tar.bz2
Download and unzip and find the SDK.
Note the different versions, different locations.
Second, make sure that your Visual Studio 2013 has VC + + installed
Another: My network disk:
Firefox SDK: Http://pan.baidu.com/s/1gdhAmrD
Demo Source: http://pan.baidu.com/s/1kTrByC3
Start example
- Open VS2013 file à new project à Win32 project
Find Np_entry.cpp,npn_gate.cpp,npp_gate.cpp
Copy the three files to the solution root directory.
After adding
Change into
Then, in the project right-click Add C + + class
Project Right-click Add New Item
Add Content:
library "Nptest" exports np_ Getentrypoints @1 np_initialize @2 np_shutdown @3 |
By this, the plugin has finished.
Compilation succeeded. If you encounter problems, be aware that the configuration and header files are added correctly.
Write to the registry:
Hkey_current_user\software\mozillaplugins\ @pyc. com/nptest;version=1.0
Add path to the generated DLL
Enter in Firefox: about:plugins refresh to see.
Summary
This document only records the development process so that you can review it later. If there is a mistake, please correct me. Because I am not familiar with VC + +, so also can not say a 123, but I have a warm heart, love to learn. I think the language is the same, as long as the kung fu deep, iron rods can also grind into needles. NPAPI Basic Knowledge Please refer to my other article: http://www.cnblogs.com/lipanpan/p/4178754.html
Npapi Firefox plugin VS2013 Development example