From bc6d9893a1f4dc317927d8d2eaea6200d1c48010 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Fri, 15 May 2026 09:25:19 -0700 Subject: [PATCH] fixes --- AGENTS.md | 205 +++++++++++++++++++++++++++++++++ package.json | 1 + src/archiver.mjs | 255 +++++++++++++++++++++++++++++++++--------- src/asset-inliner.mjs | 151 ++++++++++++++++++++++--- 4 files changed, 544 insertions(+), 68 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..0ded477 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,205 @@ +# Agent notes for local-page-archiver + +## Project overview + +This tool renders web pages in Chromium (via Playwright) and saves them as fully self-contained HTML files. All external assets (images, fonts, stylesheets) are inlined as data URIs so the resulting file works offline. + +The pipeline is: + +``` +URL ──► Playwright render ──► inject privacy filters ──► inline assets ──► write HTML +``` + +## Source layout + +- `src/cli.mjs` — CLI entrypoint. Supports `archive` and `help`. Accepts `--archive-path`, `--id`, and `--headful` flags. +- `src/archiver.mjs` — Core archiving logic. Loads privacy filters, steers the browser, injects adblockers/userscripts, and calls the inliner. +- `src/asset-inliner.mjs` — Fetches and inlines external resources (images, CSS, iframes). Also strips `