Google chrome extension 简单的npapi插件提供;没有可用于显示此内容的插件";错误消息

Google chrome extension 简单的npapi插件提供;没有可用于显示此内容的插件";错误消息,google-chrome-extension,npapi,Google Chrome Extension,Npapi,我已经从网站下载了样本 不要担心从源代码生成build.dll和manifest,test.html在sampleplugin文件夹中 问题:如果我在Chrome(最新版本)中打开test.html,我会看到一个灰色矩形,上面显示消息“没有可用于显示此内容的插件” 我错过了什么? (有人能复制这个吗?同样,无需构建,只需10秒即可下载并启动test.html) 谢谢你的回答 npsimple.dll实际上位于相对于manifest.json的插件子目录中 manifest.json: { "

我已经从网站下载了样本 不要担心从源代码生成build.dll和manifest,test.html在sampleplugin文件夹中

问题:如果我在Chrome(最新版本)中打开test.html,我会看到一个灰色矩形,上面显示消息“没有可用于显示此内容的插件”

我错过了什么? (有人能复制这个吗?同样,无需构建,只需10秒即可下载并启动test.html)

谢谢你的回答

  • npsimple.dll实际上位于相对于manifest.json的插件子目录中
manifest.json:

{
"name": "npapi_helloworld",
"version": "1.0",
"description": "a small helloworld example of npapi.",
"plugins":[
    {"path":"plugin/npsimple.dll","public":true}
]
}
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>

window.onload=函数(){
test=document.getElementById(“pluginObj”);
警报(test.sayHello());
}
已解决:


“manifest_version”:2必须添加到manifest.json:-((为什么?)

在此处共享您的相关代码..,我希望您已使用清单文件注册了NPAPI?chrome.exe--插件启动对话框,查看您的插件是否已加载。此外,您还可以看到manifest.json与test.html位于同一目录中。有什么我要做的吗?看起来像。