Search code examples
npapi

Unable to load npapi helloworld plugin as extension in chrome browser


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.


Solution

  • 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