开发者

Non-drawing Mozilla plug-in

开发者 https://www.devze.com 2022-12-18 04:20 出处:网络
I have some dll that implements some logic. I want to create wrapper that will be accessible from JavaScript of HTML pagein Mozilla Firefox browser. I have found npruntime framework开发者_如何学Go, bu

I have some dll that implements some logic. I want to create wrapper that will be accessible from JavaScript of HTML page in Mozilla Firefox browser. I have found npruntime framework开发者_如何学Go, 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().

0

精彩评论

暂无评论...
验证码 换一张
取 消