November 15, 2006
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
November 15, 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@teqdruid.com
http://www.teqdruid.com/
November 15, 2006
Sorry, I am not able to supply you with dedicated info. but probablely a guy named bobef has some code ... Have a look at D Links ->
AKIDE, lessthenequal ~~~~
hth Björn
Marcio schrieb:
> 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
November 15, 2006
== Quote from BLS (Killing_Zoe@web.de)'s article
> Sorry, I am not able to supply you with dedicated info. but probablely a
> guy named bobef has some code ... Have a look at D Links ->
> AKIDE, lessthenequal ~~~~

I think you're referring to "mozplugged" by bobef and this is the best link I could find:

http://www.dsource.org/projects/rulesplayer/wiki/mozplugged_home

> hth Björn
> Marcio schrieb:
> > 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

December 04, 2006
Yes, but I haven't translated the XPCOM headers (*COM sucks in my opinion) so with what I've done you basically create a window or windowless plugin (windowless is not tested) and you do whatever you like with it in D. You have some degree of control over the browser, some events notifications - the plugin API is wrapped. Me personally wanted to create a MPlayer plugin and move my player to XUL to make it cross platform, but I gave up because of all these XPCOM interfaces are hell. But it worked - I got a working movie inside the browser and I was able to call D from javascript and vice versa...


BLS wrote:
> Sorry, I am not able to supply you with dedicated info. but probablely a guy named bobef has some code ... Have a look at D Links ->
> AKIDE, lessthenequal ~~~~
> hth Björn
> Marcio schrieb:
>> 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
Top | Discussion index | About this forum | D home