JSON Bolt is a zero-runtime-dependency browser extension for Chrome/Chromium and Firefox that reformats raw JSON documents into a fast, readable, collapsible viewer.
- Zero runtime dependencies in the shipped extension
- Native
JSON.parseparsing with a single custom renderer - Hand-written syntax highlighting with no third-party highlighter
- Collapsible object and array sections
- Raw and formatted copy actions
- JSON MIME detection plus safe sniffing for mislabelled plain-text responses
- Chrome and Chromium-based browsers
- Firefox
src/extension/: modular runtime source for detection, rendering, viewer UI, and bootstrapscripts/build.mjs: TypeScript compilation and browser package generation.github/workflows/: CI and tagged release automationtests/: runtime behavior tests loaded against the compiled content scriptfixtures/: benchmark fixtures for repeatable performance checks
npm install
npm run build
npm testTargeted builds:
npm run build:chrome
npm run build:firefoxFormatting:
npm run format
npm run format:checkBenchmarks:
npm run benchmarkRelease packaging:
npm run package:releaseChrome and Chromium browsers run content scripts in an isolated world, so page
console checks like typeof globalThis.__JSON_BOLT_TEST__ will stay
undefined even when JSON Bolt is injected correctly.
Use these page-visible checks instead:
document.documentElement.dataset.jsonBoltState;
document.documentElement.dataset.jsonBoltReason;
document.querySelector('.jb-app');Typical values:
jsonBoltState = "activated"when JSON Bolt mounted successfullyjsonBoltState = "skipped"when the page was not eligiblejsonBoltReason = "oversized"when a response exceeded the safe render limitdocument.querySelector('.jb-app')returns the mounted viewer root when the extension took over the page
- No remote code, no
eval, and no inline event handlers - HTML-sensitive JSON content is escaped before rendering
- The extension requests only page access required for content scripts
- Invalid JSON leaves the original page untouched
Running npm run build generates unpacked extension packages in:
dist/chromedist/firefox
Load either folder as an unpacked extension during development.
Running npm run package:release creates versioned release archives in:
build/release-assets
- Every push to
mainand every pull request tomainruns GitHub Actions CI - Version tags like
v0.1.0publish GitHub Releases with Chrome and Firefox zip assets
Typical release flow:
npm version patch
git push origin main --follow-tagsMIT. See LICENSE.
