1

I have a npapi plugin composed of a dll and manifest.json file. This npapi dll is detected as plugin on chrome ie it is listed on about:plugins page. However, when I invoke this plugin in sample html page using tag, it says 'Plugin failed to load'. Any ideas why this plugin fails to load in chrome.

Thanks

Rashmi K
  • 11
  • 2
  • 3

2 Answers2

4

With the information you have provided it is impossible to say for sure, but I would guess it is one of two things:

  1. Your plugin may have an external dependency that isn't being found. If you are linking to another library that requires a .DLL file (or if you're using /MD for the DLL version of the CRT) and the DLL can't be found when the browser tries to load the plugin DLL then your plugin will silently fail to load

  2. Your plugin DLL may be loading but then throwing an exception, incorrectly handling things, etc in such a way that the browser decides that it isn't a valid plugin. Most likely this isn't the case, since Chrome usually reports something like that as a crash, not a missing plugin. You can verify this, though, by starting Chrome with the command line argument --plugin-startup-dialog, which will cause a dialog with the pid to pop up before the plugin DLL is loaded. You can then attach a debugger and tell it to continue.

OF those two, the first is by far the most common issue I see. You can troubleshoot it by getting Dependency Walker (depends.exe) and opening the DLL in-place to see what is missing. If you see ieshims.dll ignore it -- it always thinks that's missing, but finds it when the browser is running.

More tips on debugging plugins can be found at http://npapi.com/x/MYAG and of course if you're not already I'd recommend using the FireBreath framework which solves most NPAPI problems you may run into for you.

Good luck!

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Thanks for replying. I did run dependency walker against my dll and it says error opening files: 'msvcr80.dll, msvcp80.dll, msvcr80d.dll and msvcp80d.dll'. However, these files are present on my system. Then what is the error? Does it have to do anything with how I build this dll? I am using Visual studio 2005 and release build configuration for this. – Rashmi K Jul 22 '11 at 06:14
  • 1
    FYI Chrome will (unless this changed recently) report a plugin as missing if it crashes during initialization. – smorgan Jul 22 '11 at 12:47
  • the DLLs you mention are the CRT dlls; I'd recommend changing it to statically link against the CRT instead of dynamically for the plugin and it may help – taxilian Jul 22 '11 at 17:28
  • `--plugin-startup-dialog` is a wonderful aid for debugging plugin development. – Shane Holloway May 03 '12 at 00:07
  • Hi am encountering the same issue. How to statically link against CRT – Buzz LIghtyear Jul 02 '13 at 05:52
  • Comments of another question is not the place to ask a question – taxilian Jul 02 '13 at 15:19
  • I have the same issue. I ran dependency walker and it says I'm missing these: API-MS-WIN-CORE-COM-L1-1-0.DLL API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL API-MS-WIN-CORE-WINRT-L1-1-0.DLL API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL DCOMP.DLL GPSVC.DLL IESHIMS.DLL Can these be ignored, with IESHIMS.DLL? – Joel Aug 13 '13 at 22:24
1

You have to define MIME type in the plugin .rc file. Failing to do this prevent the plugin to load properly :

VALUE "MIMEType", "application/myapp"

Emmanuel Caradec
  • 2,302
  • 1
  • 19
  • 38
  • 1
    Having a `VERSIONINFO` resource is required to be listed as a plugin on Windows in Chrome's `about:plugins`. Having the `MIMEType` entry is critical to being able to actually call it! – Shane Holloway May 03 '12 at 00:09