I create one NPAPI plugin. and it can work fine in FireFox (open the
popup.html ,it can call my plugin function foo.) . and i want to use
it in Chrome. so. follow
http://code.google.com/chrome/extensions/npapi.html.
i create the manifest.json:
{
"name": "my_test",
"version": "1.0.0",
"description": "my npapi test sample",
"browser_action": {
"default_icon": "icon_19.png",
"default_title": "npapi sample",
"popup": "popup.html"
},
"plugins": [ {
"path": "plugin/npsimple.so"
} ]
}
and create folder plugin ,put the .so in it. the popup.html:
<!DOCTYPE html>
<html>
<head>
<embed type="application/x-extension-sample" id="pluginId">
</head>
<body>
<script type="text/javascript">
function foo() {
try {
alert(document.getElementById("pluginId").foo());
}
catch(e) {
alert(e);
}
}
</script>
<p>
<button onclick='foo()'>Call foo()</button>
</body>
</html>
then . i can add this extension. but it will show "Missing Plug-in".
why? what is the wrong i made . any reply are welcome. thanks.
And, i found , when add the extension , chrome will call plugin
NP_GetMIMEDescription and NP_GetVaule function for name and description