Developing a browser (Firefox) extension with D
Justin Johansson
no at spam.com
Tue Nov 17 20:57:30 PST 2009
Nick Sabalausky wrote:
> "Justin Johansson" <no at spam.com> wrote in message
> news:hdvrmr$215l$1 at digitalmars.com...
>> I'm just wondering for a moment if D might be a good vehicle for
>> developing a browser extension for Firefox, or any other browser for that
>> matter.
>>
>> Has anyone either considered doing, or has actually done, any browser
>> extension development with D and have some thoughts or experience to
>> share?
>>
>> Thanks for all feedback,
>> Justin Johansson
>
> I thought FF extensions were JS-only, is that not the case?
While extentions can be written/partly written in JS, the "system level"
for extensions is C++. The FF code base is built on a single-threaded
COM model (similar in theory but definitely not binary compatible with
Microsoft COM). Think it's called NSCOM (as in Netscape). Components
(aka objects) are managed with the usual AddRef/Release and interfaces
found with the familiar QueryInterface (familiar that is if you have
ever used MS COM). The basic interface of a component is NSIUnknown or
similar. The methods of the NSIUnknown interface are AddRef, Release
and QueryInterface. Such mechanism effectively implements a
reference-counted garbage-collection strategy.
As with a lot of COM development (in C++), people often resort to the
use of so-called smart-pointers to hide/manage calls to AddRef and
Release. So my guess/hunch is that if D is any good for writing MS COM
applications, it might also be good for writing FF extensions.
If it could be demonstrated that D was a good platform for writing FF
extensions, that might be a boon for expanding D's "market acceptance".
More information about the Digitalmars-d
mailing list