Npapi Firefox plugin VS2013 Development example

Source: Internet
Author: User

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
  1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.