Chrome extension that displays JSON on web pages with a CodeMirror editor.
When you access a page displaying raw JSON (like an API endpoint), the extension automatically detects it and shows a floating button. Clicking it opens a modal with formatted JSON and syntax highlighting. Also works by selecting any JSON on a page - a "{}" icon appears and you click to open the editor.
- Clone the project
- Run
pnpm install - Run
pnpm run build - In Chrome, go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
distfolder
pnpm start # development server
pnpm run watch # build with watch mode
pnpm run build # production buildsrc/
├── popup/ # Extension popup UI
│ ├── index.js # Popup entry point
│ ├── App.js # Main popup component
│ └── components/
│ └── Settings.js # Settings component
├── content/ # Content script (runs on web pages)
│ ├── index.js # Content script entry point
│ ├── components/ # React components
│ │ ├── CodeEditor.js # CodeMirror editor
│ │ ├── JsonModal.js # Modal component
│ │ └── Tooltip.js # Selection tooltip
│ ├── services/ # Business logic
│ │ ├── jsonDetector.js # JSON detection
│ │ ├── settingsManager.js # Settings management
│ │ └── themeManager.js # Theme management
│ └── utils/ # Content-specific utilities
│ ├── selectionHandler.js # Text selection handling
│ └── clipboard.js # Clipboard operations
├── shared/ # Shared code
│ ├── constants/ # Global constants
│ │ ├── themes.js # Theme constants
│ │ └── storage.js # Storage constants
│ ├── utils/ # Shared utilities
│ │ ├── storage.js # Chrome storage operations
│ │ └── json.js # JSON utilities
│ └── styles/
│ └── tailwind.css # Global styles
├── config/ # Configuration
│ └── codemirror.js # CodeMirror config
└── icons/
└── createIcons.js # Icon generation
The build generates separate bundles to optimize loading:
- Popup bundle: Settings UI with code splitting for vendors
- Content bundle: Everything needed for the content script (no splitting to ensure it works in all contexts)
- CodeMirror stays in its own chunk (~240KB)
- Vendors (React) in another chunk (~199KB)
- Main scripts are lightweight (~9KB each)
For detailed architecture documentation, see ARCHITECTURE.md.
- Automatic JSON page detection
- Editor with syntax highlighting
- Light/dark/system themes
- Copy to clipboard
- Auto formatting
- Responsive modal with scroll
- React 18
- CodeMirror 6
- Webpack 5
- Tailwind CSS
- Chrome Extension Manifest V3
- Run
NODE_ENV=production pnpm run build - Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
dist/folder - ✅ Extension installed and working!
- ⚡ Performance: 99% reduction in bundle sizes
- 🐛 Bugs: All identified bugs have been fixed
- 🧹 Cleanup: Optimized code without unnecessary dependencies
- 🎨 UI/UX: Modernized and responsive interface
- 🚀 Build: Robust and optimized build system
- 🔍 Auto-Detection: Automatically detects and displays JSON on pages
- Select any valid JSON on a web page
- A floating button will appear automatically
- Click to open the JSON in a formatted modal
- When accessing a page displaying raw JSON (like API endpoints)
- A floating button will appear in the bottom right corner
- Click to view the JSON formatted
- Configure in settings to enable/disable
- Click the extension icon to open settings
- Choose between themes: Light, Dark, or System
- Enable/Disable the extension
- Turn on/off JSON auto-detection
- See a live preview of your settings