Files
dsh-trustworthy/scripts
mward4 3e89edf070 v0.1.2: restore the browser APIs a non-secure page is denied
A page served over plain HTTP from anything but localhost is not a
secure context, so crypto.randomUUID and navigator.clipboard are simply
absent. Code that assumes them fails, sometimes loudly and sometimes as
a button that does nothing — billion-context calls
navigator.clipboard.writeText unguarded today.

Fold in what lanmode was still doing for us, so two plugins are not
needed to make one page work:

- shimRandomUuid  mints the UUID from crypto.getRandomValues, which is
                  not restricted to secure contexts
- shimClipboard   falls back to a hidden textarea and execCommand
- shimPwa         serves a manifest, links it, and widens the viewport
                  tag to viewport-fit=cover for standalone installs

All three default on. None of them touches request identity; they live
here so that reaching the harness from another machine is one plugin's
job rather than two.

test/shims.test.mjs evaluates the generated source in a node:vm context
that lacks both APIs, so it checks the delivered code rather than the
string that delivers it. live-probe.mjs now also asserts the shims and
the manifest reach the running harness.
2026-09-27 05:50:31 -04:00
..