Firefox Gecko SDK:NPP_GetValue 没有被调用

发布于 2024-08-20 19:28:01 字数 412 浏览 8 评论 0原文

我在

它与 Firefox 3.6 完美配合。

按照上述步骤,我创建了一个新的脚本插件(npmyplugin.dll)。我当前将 npmyplugin.dll 放置在 Firefox/plugins 以外的文件夹中。我正在注册表中注册关联的 mime 类型和插件路径。插件已正确加载。但现在浏览器没有调用NPP_GetValue

我怀疑这一定是因为我将插件放在 Firefox/plugins 以外的目录中。因此,我对 npruntime.dll (Gecko sdk 附带的示例)做了同样的事情。令人惊讶的是,npruntime.dll 脚本正在运行。请指导我在创建新插件时是否遗漏了任何重要的内容。

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 scripting was working. Please guide me whether I missing anything important while creating the new plugin.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

太阳哥哥 2024-08-27 19:28:01

在许多情况下,直到您第一次使用 javascript 访问 NPObject 时,才会调用 NPP_GetValue 来获取它。当您执行 getElementById 时,它将进行调用。

可能正在对 GetValue 进行其他调用,但您看不到它们,因为您没有处理它们。然而,这仍然不能保证。

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.

歌入人心 2024-08-27 19:28:01

抱歉这么晚才回复。我以某种方式解决了这个问题。我正在使用标签嵌入插件

然后我写了一小段javascript代码

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

似乎在执行上面的javascript之后调用了NPP_GetValue。目前我还没有令人信服的理由为什么会发生这种情况,但它确实有效,我现在很高兴。如果有人可以解释上述行为,请告诉我们。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文