MozillaZine

C++ Firefox extensions

Talk about add-ons and extension development.
DrGorilla
 
Posts: 1
Joined: November 16th, 2004, 5:41 am

Post Posted November 16th, 2004, 5:44 am

Id like to write a firefox extension in c++, is this possible? I cant find any info regarding this, please let me know of any samples or documents describing this.. thanks.

Giorgio Maone

User avatar
 
Posts: 3516
Joined: September 21st, 2004, 12:05 am
Location: Palermo - Italy

Post Posted November 16th, 2004, 7:11 am

The GUI and integration part of an extension (let's call it the "glue") is always written in JavaScript/XUL. But your JavaScript code can <b>execute external applications</b> written in C++ using <b>nsIProcess</b> API (that's what my <a href="http://www.informaction.com/mozilla/flashgot" target="_blank">FlashGot extension</a> does, for instance).

An harder but more extensible approach is packaging your C++ code as a <b>XPCOM component</b>, which is an object whose methods are directly callable by JavaScript (do you remember VBScript/MS COM?): take a look to http://www.mozilla.org/projects/xpcom/book/cxc/

Hope it helps

iosart

User avatar
 
Posts: 87
Joined: July 29th, 2004, 2:34 am

Post Posted November 16th, 2004, 6:38 pm

I've written a detailed tutorial about creating a C++ XPCOM component a while back:
http://www.iosart.com/firefox/xpcom/

The tutorial comes with source code that can be compiled and run both on Windows and Linux.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests