MIME タイプから各タイプを処理するネイティブ クライアント モジュールへの 1 つ以上のマッピング。たとえば、次のスニペットの太字のコードは、ネイティブ クライアント モジュールを OpenOffice スプレッドシートの MIME タイプのコンテンツ ハンドラとして登録します。
{
"name": "Native Client OpenOffice Spreadsheet Viewer",
"version": "0.1",
"description": "Open OpenOffice spreadsheets, right in your browser.",
"nacl_modules": [{
"path": "OpenOfficeViewer.nmf",
"mime_type": "application/vnd.oasis.opendocument.spreadsheet"
}]
}
「path」の値は、拡張機能ディレクトリ内のネイティブ クライアント マニフェスト(.nmf
ファイル)の場所です。ネイティブ クライアントと .nmf
ファイルについて詳しくは、ネイティブ クライアントの技術概要をご覧ください。
各 MIME タイプは 1 つの .nmf
ファイルにのみ関連付けることができますが、1 つの .nmf
ファイルで複数の MIME タイプを処理できます。次の例は、3 つの MIME タイプを処理する 2 つの .nmf
ファイルを含む拡張機能を示しています。
{
"name": "Spreadsheet Viewer",
"version": "0.1",
"description": "Open OpenOffice and Excel spreadsheets, right in your browser.",
"nacl_modules": [{
"path": "OpenOfficeViewer.nmf",
"mime_type": "application/vnd.oasis.opendocument.spreadsheet"
},
{
"path": "OpenOfficeViewer.nmf",
"mime_type": "application/vnd.oasis.opendocument.spreadsheet-template"
},
{
"path": "ExcelViewer.nmf",
"mime_type": "application/excel"
}]
}
注: 「nacl_modules」を指定しなくても、拡張機能でネイティブ クライアント モジュールを使用できます。「nacl_modules」は、ブラウザでネイティブ クライアント モジュールを使用して特定の種類のコンテンツを表示させる場合にのみ使用します。