מיפוי אחד או יותר מסוגי MIME למודול Native Client שמטפל בכל סוג. לדוגמה, הקוד המודגש בקטע הקוד הבא רושם מודול של Native Client כגורם handler של תוכן לסוג ה-MIME של הגיליון האלקטרוני OpenOffice.
{
"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. בדוגמה הבאה מוצג תוסף עם שני קובצי .nmf
שמטפלים בשלושה סוגי MIME.
{
"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"
}]
}