简体   繁体   中英

Basic example of a scriptable plugin for Firefox in C++ with VS2005/8

My experience to write a plugin for Firefox is below zero. Is someone out there who could point me to sample code on how to get this accomplished in C++ with VS2005/8?

What I need to do with JavaScript in the hosting html page is something like this:

var obj = document.getElementById("MyFFPlugin");

var value = obj.CalculateValue;

// Work with calculated value

The SDK has basic samples on how to write mozzila plugins which can be downloaded here: http://mxr.mozilla.org/seamonkey/source/modules/plugin/tools/sdk/

Here is the official mozilla plugin site http://www.mozilla.org/projects/plugins/

Hope it helps.

I highly recommend using Nixysa http://code.google.com/p/nixysa/ , which wraps NPAPI. From the site:

Nixysa is a framework written in Python to automatically generate glue code for NPAPI plugins (plugins for browsers such as Google Chrome or Firefox), letting you easily expose C++ classes to Javascript from a simple IDL representation. Nixysa was originally conceived for the needs of O3D, but is flexible enough to support a wide range of use cases.

Try it

Check out the code following the instructions here and try the sample in examples/complex.

The sample includes a Visual Studio 2005 project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM