简体   繁体   English

Windows 7中的NPAPI插件问题

[英]NPAPI plugin problems in Windows 7

I have a NPAPI plugin which I have written and been using for some time with Firefox 3.x with no problems. 我有一个NPAPI插件,我已经编写并在Firefox 3.x中使用了一段时间,没有任何问题。

The object is defined as follows - 该对象定义如下-

<object class="someClass" id="pluginobj" type="application/x-plugintype"></object>

I then call methods on it using the following format - 然后,我使用以下格式对其调用方法-

if( document.getElementById("pluginobj") != null )
{
    document.getElementById("pluginobj").someMethod(someParams));
}

This is how I understand it should be done and has always worked fine. 我知道应该这样做,并且一直都能正常工作。 However, I recently installed this same plugin on a Windows 7 machine (with the same version of Firefox) and it now fails to find the functions defined in the plugin, so I get the following error - 但是,我最近在Windows 7计算机(具有相同版本的Firefox)上安装了相同的插件,但现在找不到该插件中定义的功能,因此出现以下错误-

Error: document.getElementById("pluginobj").someMethod is not a function 错误:document.getElementById(“ pluginobj”)。someMethod不是函数

Nothing has changed at all within the plugin, this errors occurs for any method that is called, not a particular one, and it still works fine on Windows XP machines with no problems. 插件中的任何内容都没有改变,对于任何被调用的方法(不是特定方法),都会发生此错误,并且在Windows XP计算机上仍然可以正常工作,没有任何问题。

Very confused! 很迷茫! Could anyone help? 有人可以帮忙吗? Thanks. 谢谢。

Note: I've also tried logging inside my plugin and it appears it's not even getting in to the NP_Initialize and NP_GetEntryPoints methods. 注意:我也尝试过在插件内部登录,看来它甚至没有进入NP_Initialize和NP_GetEntryPoints方法。

I have seen some suggestions around that it could be to with dependencies and libraries being linked to the plugin, but i'm not sure what could be missing on win 7? 我已经看到一些建议,可能是依赖项和库链接到了插件,但是我不确定win 7可能缺少什么?

Dependency Walker is showing a error saying that the "side-by-side configuration information is incorrect"? Dependency Walker显示错误,指出“并行配置信息不正确”?

Are you linking to other DLL files from your npapi plugin? 您是否要从npapi插件链接到其他DLL文件? Windows 7 works differently in how it finds DLL files, though I don't know the details. Windows 7在查找DLL文件的方式上有不同的工作方式,尽管我不知道细节。 The times I've seen this with plugins in the past the problem was that on windows 7 one of the dll files couldn't be found. 我过去在插件上看到过这个问题,当时的问题是在Windows 7上找不到dll文件之一。 You could try copying dependency dll files to your system32 directory (not permanently, just to see if that's the issue). 您可以尝试将依赖项dll文件复制到您的system32目录(不是永久性的,只是为了查看是否是问题所在)。 I would expect that there it would be able to find it. 我希望在那里可以找到它。

If that's the issue, I unfortunately am not certain how to fix it, but it might help. 如果那是问题,很遗憾,我不确定如何解决它,但这可能会有所帮助。

Another possibility based on the side-by-side configuration issue thing is that your visual studio project is creating a manifest that is telling windows that it requires a specific version of one of the DLLs that isn't there on windows 7. See: http://buffered.io/2008/05/17/resolving-side-by-side-configuration-issues/ 基于并行配置问题的另一种可能性是,您的Visual Studio项目正在创建一个清单,该清单告诉Windows它需要Windows 7中不存在的DLL之一的特定版本。请参阅: http ://buffered.io/2008/05/17/resolving-side-by-side-configuration-issues/

I think I've resolved that issue in plugins before by disabling the manifest. 我认为我已经通过禁用清单解决了插件中的问题。 I'm not sure; 我不确定; I've never had this issue with the way that FireBreath generates npapi plugin dlls, so I haven't needed to worry about it in the last year. 我从未遇到过FireBreath生成npapi插件dll的问题,因此在去年,我无需担心。 You might consider looking at FireBreath , which works on both IE and Firefox (activex and npapi) and has a very good community for tracking down issues like this. 您可能会考虑看看FireBreath ,它在IE和Firefox(activex和npapi)上均可使用,并且有一个很好的社区来跟踪此类问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM