lynxseal_pdfjs

/app/lynxseal_pdfjs/

Embedded pdf.js viewer, served from its own origin (pdfjs.lynxseal.com) so any parser/XSS bug in pdf.js is sandboxed away from portal and wrapper origins (no shared cookies, no shared localStorage, no shared scripts). Parents communicate with the viewer via postMessage.

Files

postMessage protocol

Parent embeds:

<iframe src="https://pdfjs.lynxseal.com/web/viewer.html"></iframe>

Viewer → parent (once initialized):

{ type: 'pdfjs:ready' }

Parent → viewer (after ready):

{
  type: 'pdfjs:open',
  id: <correlation id>,
  data: <ArrayBuffer>,        // PDF bytes (transferred, not copied)
  hideToolbarIds: ['print','download','openFile','viewBookmark']   // optional
}

Viewer → parent (per request id):

{ type: 'pdfjs:opened', id: <id> }
{ type: 'pdfjs:error',  id: <id>, message: <string> }

The viewer accepts open requests from any parent that embeds it. There’s nothing sensitive on this origin to gatekeep — anyone who can embed the viewer can also just render their own PDFs in their own page. The bridge posts replies back to event.origin, and parents validate that messages they receive came from pdfjs.lynxseal.com.

Audit

Two files = the entire pdf.js audit surface:

  1. The ZIP — sha256 matches the upstream release hash.
  2. sw.js — read it, it does only what’s described here.

If either is tampered, the SW refuses to extract and the viewer never loads.