MIME 유형에서 각 유형을 처리하는 Native Client 모듈로의 하나 이상의 매핑입니다. 예를 들어 다음 스니펫에서 굵게 표시된 코드는 Native Client 모듈을 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'의 값은 확장 프로그램 디렉터리 내 Native Client 매니페스트 (.nmf
파일)의 위치입니다. Native Client 및 .nmf
파일에 대한 자세한 내용은 Native Client 기술 개요를
참고하세요.
각 MIME 유형은 하나의 .nmf
파일에만 연결될 수 있지만 단일 .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'를 지정하지 않고 확장 프로그램에서 Native Client 모듈을 사용할 수 있습니다. 브라우저에서 Native Client 모듈을 사용하여 특정 유형의 콘텐츠를 표시하도록 하려는 경우에만 'nacl_modules'를 사용합니다.