queelius/pagevault: v0.3.0 — SPA Rendering & Script Activation

Read full text
Authors: Alex Towell
Cited by: 0

Abstract

Patch release fixing two critical bugs found in v0.4.0 post-release code review. Fixes 🔴 `lock_html` no longer drops runtime injection When re-running `pagevault lock` on a file with existing `data-pv-v4` elements but a missing runtime, the runtime was being injected into the parsed DOM but then thrown away because the function returned the original input string. Re-locking could never repair a file that had lost its runtime — output was byte-identical to input. Fix: `_inject_runtime` now returns whether it actually injected; `lock_html` returns the serialized soup if any mutation happened. Regression test added. 🔴 `pagevault inspect` viewer list never shown The viewer-detection regex in `inspect` matched v0.3.x dispatch shape (`'mime/type': __pv_viewer`), but v0.4.0 uses `window.__pv_viewers['mime/type'] = viewer`. The "Viewers:" line silently never printed. Fix: regex updated to match v4 shape. 🟡 Format detection no longer misfires on stray script ids `inspect` and `_find_first_envelope` previously detected wrap format by searching for ` ` anywhere in the document. A region-encrypted page containing plaintext that referenced `pv-meta` (e.g. example documentation) would be misclassified as wrap. Fix: detect format via `` marker on the element instead. Other improvements 10 small simplifications committed since v0.4.0 (pre-release): `_html_escape` replaced with stdlib `html.escape`, `encrypt_mode` deprecated param removed, lock-helper deduplication, json import hoisted, `_wrap_iife` extracted to share IIFE assembly between `build_region_js`/`build_wrap_js`, etc. Net -19 lines. Upgrade ```bash pip install --upgrade pagevault ```

Fields of Study & Subjects

Mobile and Web Applications Digital Rights Management and Security Web Application Security Vulnerabilities

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
15 March 2026
Language
EN