Monday, September 18, 2006


For those who want to create some plugin for Firefox/Mozilla written in C++ i recommend
the following example as a good start.

Download the stable mozilla development environment named Gecko from

Download two additional libraries and from and
Extract libIDL-0.6.dll from and put it into C:\gecko-sdk\bin

C:> unzip
C:> copy libIDL-0.6.dll C:\gecko-sdk\bin
extract glib-1.2.dll from and put it into C:\gecko-sdk\bin
C:> unzip
C:> copy glib-1.2.dll C:\gecko-sdk\bin

Note that to build the sample you will need VS6 + SP4 or greater, you will need cygwin in order to build nspr library and be able to use an autoconf based make system now used. Cygwin for Windows Platform can be found here where as nspr source code can be found here
You should be able to build nspr yourself with MSDEV6, with the command line tools and cygwin.

The only thing you need that's not part of MSDEV or cygwin is the binary nsinstall.exe which is available from

If you don't want to build the nsrp library you can just grab the binaries from here
but i strongly recommend jsut to rely on the latest gecko SDK. For firefox 1.5 take the
gecko 1.8b1 sdk otherway you will see some strange error such as TypeError Component[cid] has no properties and no interface can be expanded in XPCOM Viewer for your component.

Replace old library in the Sample project by the latest one libnspr4.lib libplds4.lib libplc4.lib

And off course remember that all your script will be server/client based driven.
For Mozilla/Firefox you will use XPCOM and for Internet Explorer you will use ACTIVE X control for custom Dialog call from script.

To view if your XPCOM has been properly deployed and install in Mozilla 1.5

To debug you XPCOM

Nice plugin sample to provide abstraction for all Media Player


No comments: