2

I have a NPAPI plugin which I have written and been using for some time with Firefox 3.x with no problems.

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 -

Error: document.getElementById("pluginobj").someMethod is not a function

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.

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.

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?

Dependency Walker is showing a error saying that the "side-by-side configuration information is incorrect"?

Adam Cobb
  • 894
  • 4
  • 14
  • 33
  • Could you specify the exact version of FF? From FF 3.6.4 the plugins are launched in separate process, maybe it's related to your problem. Did you try your plugin in Chrome on Windows 7? – DReJ Dec 08 '10 at 10:33
  • FF is version 3.6.12 - The same version i'm running on my XP system with no problems... – Adam Cobb Dec 08 '10 at 10:46
  • New note makes sense. If you have side-by-side issue, you can examine Windows Error Log and figure out what assemblies are missing – DReJ Dec 08 '10 at 12:12

1 Answers1

0

Are you linking to other DLL files from your npapi plugin? Windows 7 works differently in how it finds DLL files, though I don't know the details. 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. You could try copying dependency dll files to your system32 directory (not permanently, just to see if that's the issue). 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/

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. 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.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Thanks for the comments, I resolved the issues in the end yesterday. Was basically down to the manifest file trying to drag in dependencies that I didn't actually need, due to me not configuring the project quite correctly! :) – Adam Cobb Dec 09 '10 at 08:54
  • That would do it =] Mark an answer or add one... =] – taxilian Dec 09 '10 at 19:40