Documentation
    Preparing search index...

    Function prepareNappletSrcdoc

    • Prepare verified artifact HTML with CSP first, then the mandatory namespace. There is no CSP opt-out. Resolve and verify the artifact before calling this; bind its identity to the sandboxed iframe before assigning the returned srcdoc. Keep the original verified bytes for hashing and caching.

      Parameters

      • html: string

        Already-verified napplet artifact HTML.

      • options: NappletSrcdocOptions

        Exposed domains and validated host CSP changes.

      Returns string

      Srcdoc HTML with policy and bootstrap preceding authored content.

      iframe.sandbox.value = 'allow-scripts';
      iframe.srcdoc = prepareNappletSrcdoc(verifiedHtml, {
      domains: ['shell', 'theme'],
      csp: { directives: { 'media-src': ['blob:'] } },
      });