Skip to content

feat(json-viewer): format JSON documents opened in a tab - #14

Merged
maxgfr merged 5 commits into
release-nextfrom
issue-6-json-viewer
Nov 20, 2026
Merged

maxgfr merged 5 commits into
release-nextfrom
issue-6-json-viewer

Conversation

@maxgfr

@maxgfr maxgfr commented Nov 20, 2026

Copy link
Copy Markdown
Owner

JSON documents opened in a tab (e.g. https://jsonplaceholder.typicode.com/posts/1) render as a readable tree, like the JSON Formatter extension.

  • Runs only on application/json, text/json and *+json documents whose body is a single <pre>; Chrome's own pretty-print control is hidden, the original <pre> is left untouched. Idempotent.
  • Plain DOM in a shadow root (no React in the content script): collapsible, colored tree with {n} / [n] counts, lazy children (500 at a time), http(s) strings as links, click a key to copy its path ($.data[0].id), Parsed / Raw, Expand / Collapse all, filter, wrap, Copy, Download (posts-1.json), light and dark themes.
  • Invalid JSON: raw text with "Invalid JSON at line X, column Y". Over 10 MB: raw with "Format anyway".
  • Options › JSON viewer: "Format JSON pages" registers the content script on every site (asks for all-sites access, optional).
  • Palette › "Format this JSON page" formats the current tab through activeTab, also JSON served as text/plain.

Tests: 23 unit tests (logic and a happy-dom render), 14 e2e checks (palette action and options toggle).

Closes #6

@maxgfr
maxgfr changed the base branch from main to release-next November 20, 2026 10:47
@maxgfr
maxgfr merged commit 668ff22 into release-next Nov 20, 2026
2 checks passed
@maxgfr
maxgfr deleted the issue-6-json-viewer branch November 20, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Format JSON documents opened in a tab

1 participant