Firefox Gecko SDK : NPP_GetValue not getting called
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.
精彩评论