البيان - وحدات Nacl

عملية ربط واحدة أو أكثر من أنواع MIME إلى وحدة Native Client التي تعالج كل نوع. على سبيل المثال، يسجّل الرمز الغامق في المقتطف التالي وحدة Native Client كمعالج للمحتوى لنوع 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"
  }]
}