http://code.google.com/p/npapi-chrome-plugin-helloworld-example/からサンプルをダウンロードしまし た。ソース、ビルドされた .dll、マニフェスト、および test.html からのビルドについて心配する必要はありません。 sampleplugin フォルダにあります。
問題: Chrome (最新) で test.html を開くと、「このコンテンツを表示するためのプラグインがありません」というメッセージが表示された灰色の四角形が表示されます。
私は何が欠けていますか?(誰でもこれを再現できますか? 繰り返しますが、ビルドする必要はありません。test.html をダウンロードして起動するのに 10 秒しかかかりません)
回答ありがとうございます
- npsimple.dll は実際には、manifest.json に関連するプラグイン サブディレクトリにあります。
マニフェスト.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>