JavaScript 使用可能なプラグインを取得する
「length」プロパティでプラグインの数を出し、そのブラウザで使用可能なプラグイン一覧を作成しています。「name」プロパティはプラグインの名前を、「filename」プロパティはファイル名を、「description」プロパティはその詳細をそれぞれ返します。
JavaScript1.1で追加された、読み取り専用プロパティです
- オブジェクト(配列):navigator.plugins
- プロパティ:navigator.plugins[n].name
- プロパティ:navigator.plugins[n].filename
- プロパティ:navigator.plugins[n].description
var L = navigator.plugins.length;
document.write( L );
document.write("個". bold());
document.write("<p>");
document.write("タイプ/ファイル名/説明".bold());
document.write("<br>");
for (i=0; i<L; i++) {
document.write (navigator.plugins [i].name);
document.write(" / ".bold());
document.write (navigator.plugins [i].filename);
document.write(" / ".bold());
document.write (navigator.plugins [i].description);
document.write("<br>");
}
