I have some dll that implements some logic. I want to create wrapper that will be accessible from JavaScript of HTML page in Mozilla browser. I have found npruntime framework,but it seems supports only window control, i don't need GUI. I am looking for mechanism like ActiveXObject implemented in Internet Explorer.
You are looking for the NPAPI. Its documented here on MDC, here is an excellent tutorial for it.
There are alternatives to doing it directly however, SWIG can generate code to interface NPAPI (if i remember that right) and there is also FireBreath which hides browser and platform differences from you.
NPAPI was designed to display alternative content in websites, thus non-drawing plugins aren't explicitly supported. If you know however that your plugin won't get shown in the page anyway (i.e. the object or embed element will be hidden anyway), you don't have to do anything in NPP_SetWindow()
or if you get drawing events in NPP_HandleEvents()
. Alternatively you can just draw some static background.
The best equivalent to ActiveXObject()
would be to have a factory method for your plugin that creates new scriptable objects, i.e. something like myPlugin.createObject()
.