plugins for Firefox or Thunderbird in D?

John Demme me at teqdruid.com
Wed Nov 15 09:13:39 PST 2006


Marcio wrote:

> Hi,
> 
> Has anybody tried writing either Firefox or Thunderbird plugins in D?
> Having to use C++ is just a no-no.
> 
> I know one can use JavaScript for plugins, but I think the
> possibilities are different from using C++. So, ideally I'd like the
> full extension API available, but use D.
> 
> Thanks,
> 
> marcio

I haven't done this, but I have looked into it, and I have some experience
with writing FF extensions in JS (it sucks.)  Mozilla does everything-
literally everything- with XPCOM.  XPCOM is natively C++, but other
languages like Python, Java, and JS have ports of it.  Unfortunately, you
can't just use C.

The first step to using D would be getting an XPCOM interface in D.  I had
considered using BCD to wrap the C++ interface.  You might also look at how
Java does it.

Once you've got the XPCOM interface working, your D program should be able
to talk to all the other components in Mozilla, so you're mostly done.  You
just need to figure out how to get Mozilla to load some D code.  I don't
know how this is done in Windows, but I think in Linux, Mozilla will load
shared objects, which DMD still can't generate (AFAIK.)

If you get it working, let me know!  Good luck.

-- 
~John Demme
me at teqdruid.com
http://www.teqdruid.com/



More information about the Digitalmars-d mailing list