NPAPI プラグインがあり、Web ページに埋め込む前にそのバージョンを検出したいと考えています。バージョンが最新でない場合、ユーザーにプラグインの更新を求めるメッセージを表示したいと思います。
現在、次の方法で実装されています
if (navigator.mimeTypes && navigator.mimeTypes["application/myplugin"]) {
{
// some code here
if(navigator.plugins["myplugin"] && navigator.plugins["myplugin"].version >= latest_version) {
// we have the latest version (embed the plugin into web page)
document.write ("<object id='plugin'><embed ....></object>");
} else {
document.write ("Show message here");
}
// some code
}
問題はnavigator.plugins["myplugin"].version
、Firefox では問題なく動作するが、Chrome では動作しないことです。version
Chrome はプロパティを公開しません。NPAPI コードに独自のプロパティを追加できますが、プラグインをページに埋め込む前に使用する方法がわかりません。
回避策はありますか?
前もってありがとう、アンドリュー