sanitize-bookmarks.mjs accepted any JSON object and rewrote only "url" and "title". Chrome's profile Bookmarks file keeps titles under "name" (plus meta_info and a base64 sync_metadata blob), so it came out with every title intact, passed the host-only leak check, and was written as "sanitized" — the exact file a reporter whose import failed would attach. - JSON dialects are recognised by shape (BookmarkMagic, Chrome profile, Firefox backup); any other JSON is refused. Rewriting is default-deny: a small tokenizer tracks the key of every string value and replaces all of them except structural keys (types, ids, timestamps, root GUIDs), by span, so layout and key order stay byte-identical. - The backstop now reads the output's TEXT: for HTML it strips markup and refuses on any word that is not a placeholder — independent of the rewriting rules, unlike the old host-only check whose test shared its blind spots. <DD class=…> notes, file: ICON_URIs and <H1>/<TITLE> owner names are rewritten. - Attribute values decode in one pass (CodeQL js/double-escaping), <DD> bodies are found in linear time (Sonar S8786), the input is never overwritten, size is checked before reading, and bytes are bytes. - The 627-line file is split into scripts/sanitize/ modules; the user-facing entry stays plain .mjs for reporters on any Node. gen-fixture.mjs validates its flags (whole numbers >= 1, values required, no unknown flags) and its loop visibly advances (Sonar S2189 blocker). gen-icons.mjs says what is true: it is the icons' source of truth. Every script now carries // @ts-check and tsconfig.scripts.json runs them through the TS 7 tsc in `npm run check`; docs/10's size rule names .mjs. Regenerated icons are byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
618 B
Plaintext
45 lines
618 B
Plaintext
# Dependencies
|
|
node_modules/
|
|
|
|
# WXT build output + generated types
|
|
.output/
|
|
.wxt/
|
|
stats.html
|
|
stats-*.json
|
|
|
|
# Test / coverage (Vitest 5 writes reporter output under .vitest/)
|
|
coverage/
|
|
.vitest/
|
|
*.tsbuildinfo
|
|
|
|
# WXT runner config — holds local browser paths, never shared
|
|
web-ext.config.ts
|
|
|
|
# Editors
|
|
.idea/
|
|
.vs/
|
|
.vscode/*
|
|
!.vscode/extensions.json
|
|
*.swp
|
|
|
|
# OS
|
|
.DS_Store
|
|
._*
|
|
Thumbs.db
|
|
Desktop.ini
|
|
|
|
# Logs
|
|
*.log
|
|
npm-debug.log*
|
|
|
|
# Local env
|
|
.env
|
|
.env.local
|
|
.env.*.local
|
|
|
|
# Generated fixtures that are too big to commit (scripts/gen-fixture.mjs writes
|
|
# here on demand — docs/11 §2)
|
|
tests/fixtures/generated/
|
|
|
|
.claude/
|