开发者

Firefox Gecko SDK : NPP_GetValue not getting called

开发者 https://www.devze.com 2022-12-19 15:57 出处:网络
I have tried out the NPRuntime sample provided with the Gecko SDK 1.9.1 with the help of this link. It works perfectly fine with Firefox 3.6.

I have tried out the NPRuntime sample provided with the Gecko SDK 1.9.1 with the help of this link.

It works perfectly fine with Firefox 3.6.

Following the above steps I created a new scripting plugin (npmyplugin.dll). I am currently placing npmyplugin.dll in a folder other than Firefox/plugins. I am registering the associated mime-type and plugin path in the registry. The plugin gets loaded properly. But now the browser is not calling NPP_GetValue.

I was suspecting that it must be because I am placing the plugin in a directory other than Firefox/plugins. Hence I did the same with npruntime.dll (the sample which comes with Gecko sdk). Suprisingly npruntime.dll scr开发者_如何学运维ipting was working. Please guide me whether I missing anything important while creating the new plugin.


NPP_GetValue doesn't get called to get the NPObject until the first time you access it with javascript in many cases. When you do a getElementById, it will make the call.

Likely other calls to GetValue are being made, but you aren't seeing them because you aren't handling them. However, that's still not guaranteed.


Sorry for replying so late. I somehow solved the problem. I was embedding the plugin using tag

then i wrote a small javascript code

var MyWorkingPlugin = document.getElementById('MyPlugin');

It seems that after executing the above javascript NPP_GetValue was called. Currently I have no convincing reason why it happened but it worked and I am happy for the moment. If anyone can explain the above behaviour please let us know.

0

精彩评论

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

关注公众号