מניפסט – מודולים של Nacl

מיפוי אחד או יותר מסוגי 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"
  }]
}
הערה: אפשר להשתמש במודולים של Native Client בתוספים בלי לציין "nacl_modules". יש להשתמש ב-"nacl_modules" רק אם רוצים שהדפדפן ישתמש במודול Native Client כדי להציג סוג מסוים של תוכן.