Skip to content

Vault Publisher 0.1.8

Latest

Choose a tag to compare

@NoteNerdOfficial NoteNerdOfficial released this 19 Nov 03:32

HTML prototypes whose scripts load their own images and data now publish, locked or not.

Files a page's script loads are reported

A page published as-is takes with it the files its HTML names. A path its script builds while it runs ("img/" + name + ".jpg") never appears in the HTML, so that file used to stay behind silently, and the first sign was a broken image on the live site.

The build report now lists every file sitting in an as-is page's folder that nothing published, grouped by folder, and the publish log and a notice say so too. The fix is to add that folder under Publish folders whole. Files a page asks for from the server root (/assets/index.js) are left off the list, since they are reported already with the fix that works: build with a relative base.

Locked sites serve every file through a service worker

On a password-locked site, every file is published encrypted, and the page used to repair only the references in its HTML at the moment it unlocked. A picture a script added later, a fetch() for data, or a lazily loaded chunk asked for a name that was not on the server and failed.

A locked site now also publishes a service worker, osp-sw.js, at its root. Once a page has unlocked, the worker decrypts any locked file the page asks for, whenever and however it asks:

  • Pictures added by script, fetch()ed JSON, and code-split applications all work behind a password.
  • The page is written exactly as published, with no blob URLs.
  • The worker never stores the key. It asks the page, which answers from the tab's own storage, so the key still lasts no longer than the tab.
  • Publishing a site without a password after it was locked replaces the worker with one that removes itself.

Browsers without service workers (some private windows, a site opened from disk) fall back to the old behaviour. Tested in Chromium on GitHub Pages; not yet in Safari.