2

Downloaded the NPAPI hello-world plugin from https://github.com/axgle/npapi-chrome-plugin-helloworld and packaged it as a chrome extension (crx) using Chrome developer mode.

Loaded the above extension in chrome browser and tried to open test.html (provided with above plugin) in chrome browser. But it says "Could not load plugin"

Below is the source code of test.html

<doctype html>
<html>
<head>
<script>
window.onload = function(){
    test = document.getElementById("pluginObj");
    alert(test.sayHello());
}
</script>
</head>
<embed id="pluginObj" type="application/x-helloworld"> 
<body></body>
</html>

As per my validation, plugin is getting embedded (since on altering test it gives HTML document object) but unable to invoke sayHello method of the plugin.

However when I tried to load the above extension in another PC over there it loaded properly and was able to invoke sayHello method of the plugin. Both systems have same OS (Windows XP + SP3) and both are using same version of chrome browser (23.0.1271.97 m)

Appreciate any help on this front.

Yusubov
  • 5,815
  • 9
  • 32
  • 69
Goku
  • 73
  • 5

1 Answers1

1

When you added it to the CRX did you mark it public? If you don't it won't be visible outside of the extension.

See the relevant docs

Here is another relevant question: Google Chrome Extensions and NPAPI

Community
  • 1
  • 1
taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Yes I did. Structure of manifest.json { "name": "npapi_helloworld", "version": "1.0", "background_page":"test.html", "manifest_version": 2, "description": "a small helloworld example of npapi.", "plugins":[ {"path":"plugin/npsimple.dll","public":true} ] } – Goku Jan 03 '13 at 04:12
  • try opening the DLL in dependency walker and see if there are any missing dependencies on the machine it doesn't work on that are there on the one it does. msvcrt.dll comes to mind quickly – taxilian Jan 03 '13 at 05:53
  • Yes DLL was having dependency on msvcp100d.dll and msvcr100d.dll. Packaged these dlls along with the extension and it worked. Appreciate all your help. – Goku Jan 03 '13 at 08:41
  • Good! Mark an answer? (click the checkbox next to the answer) – taxilian Jan 03 '13 at 16:18