A part of my Idea Series
damn.js is a Chrome DevTools extension that mirrors console errors in real time and provides AI-powered explanations plus structured debugging prompts.
It does not auto-fix your errors.
Instead, it helps you understand what went wrong and generates ready-to-use prompts for AI assistants like Claude, Cursor, or ChatGPT.
What it does:
- Mirrors
console.error,window.onerror, and unhandled promise rejections in real time - Provides AI-powered explanations with relevant documentation references
- Generates structured, copy-paste-ready debugging prompts for AI agents
- Keeps a local history of recent errors for quick reference
The goal is to reduce friction by providing contextual error insights directly inside DevTools, eliminating constant context switching between console, search engines, and AI tools.
Mirror errors in real time, explain them with AI, and generate perfect debugging prompts β all inside DevTools.
This significantly reduces context switching and helps developers debug faster without leaving the console. damn.js acts as a bridge between your errors and AI-powered assistance, making debugging more efficient and less frustrating.
Real-time Error Pipeline:
- An injected script hooks into
console.error,window.onerror, and promise rejections - Errors are forwarded via
window.postMessageβ content script β DevTools panel - A custom DevTools panel (
damn.js) displays all errors in real time with filtering options
AI-Powered Features:
- Explain Button π‘: Calls backend API to get AI-powered explanation, likely causes, and fixes with documentation references
- Spell Button β¨: Generates a structured, detailed debugging prompt optimized for AI assistants
- Developers can copy the generated "spell" and paste it directly into Claude, Cursor, ChatGPT, etc.
Backend:
- Serverless API (Vercel + Express) powered by AI models
v1 of damn.js is fully functional!
The backend is already hosted and ready to use.
- Clone the
vercel-versionbranch:
git clone -b vercel-version https://github.com/yourusername/damnjs.git
cd damnjs-
Load the extension in Chrome:
- Open
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select the
extension/folder
- Open
-
Start using damn.js immediately β no backend setup needed!
Note: v1 is not published on the Chrome Web Store due to developer registration fee constraints. However, it works perfectly via the "Load unpacked" method.
File structure, features, and implementation details may change at any time without notice.
Expect:
- Refactoring and restructuring
- Feature additions/removals
- API changes
- UI/UX iterations
- Architecture evolution
The codebase is fluid and experimental as we work toward a stable MVP.
This project is actively being shaped, and features may:
- evolve
- be modified
- be added or removed
- be completely restructured as development continues
Current implementation (subject to change):
Automatically captures console.error, window.onerror, and unhandled promise rejections from any webpage.
Dedicated "damn.js" panel with dark theme, filtering options, and clean error cards.
Click "π‘ Explain" on any error to get:
- Clear explanation of what the error means
- Likely causes
- Practical fixes and debugging steps
- Documentation references (MDN, Stack Overflow, etc.)
Click "β¨ Spell" to generate a structured debugging prompt that includes:
- Error details and context
- Stack trace
- Recent error history
- Specific questions for AI assistants
Note: Tech stack may evolve during development
Frontend (Chrome Extension):
- Manifest V3
- Vanilla JavaScript + CSS
- Chrome DevTools APIs (
chrome.devtools.panels) chrome.runtimemessagingwindow.postMessagefor page β extension communication
Backend (Serverless API):
- Vercel + Express
- OpenAI GPT-4 Turbo (or Google Gemini)
- Node.js
- CORS + dotenv
Architecture:
- Injected script (page context) β Content script (bridge) β DevTools panel (UI)
- DevTools panel β Backend API β AI model β Response
β οΈ UNDER ACTIVE DEVELOPMENT
These setup instructions are subject to change at any time as the project evolves.
Dependencies, configuration steps, and file structure may be modified without notice.
If you encounter issues, check for updates or open an issue.
- Node.js (v18 or higher recommended)
- npm or yarn
- Chrome Browser (latest version)
- API Key for AI service (OpenAI or Google Gemini)
git clone https://github.com/yourusername/damnjs.git
cd damnjscd damnjs_extension/api
npm installCreate a .env file in the api/ directory:
GEMINI_API_KEY=your_gemini_api_key_here# In the api/ directory
node index.jsThe API should be running at http://localhost:3000 (or the port Vercel assigns).
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in top right)
- Click Load unpacked
- Select the
damnjs_extension/extension/folder - The damn.js extension should now appear in your extensions list
Update the API endpoint in extension/panel/api-client.js to point to your local backend:
const API_BASE_URL = 'http://localhost:3000'; // Change as needed- Open any webpage in Chrome
- Open DevTools (
F12orCtrl+Shift+I) - Look for the damn.js tab in DevTools
- Trigger an error on the page (e.g., open console and type:
throw new Error('test')) - The error should appear in the damn.js panel
- Test the "π‘ Explain" and "β¨ Spell" buttons
- Hot Reload: After making changes to extension files, click the reload icon on
chrome://extensions/for the damn.js extension - Backend Changes: Restart the dev server after modifying backend code
- API Keys: Never commit your
.envfile. It's included in.gitignore - CORS: The backend is configured for development. For production, update CORS settings accordingly
- Extension not appearing: Ensure you selected the correct folder (
extension/not the root) - API errors: Check that your API key is valid and the backend is running
- No errors showing: Check browser console for messaging errors between scripts
- DevTools panel blank: Refresh the page and reopen DevTools
Remember: This is an experimental project. Setup steps, dependencies, and configuration may change as development progresses.
β οΈ Subject to change β File structure is being actively developed and may be reorganized
damnjs_extension/
β
βββ api/ # Backend (Vercel Serverless)
β βββ index.js # Main Express app
β βββ package.json
β βββ handlers/
β βββ explain.js # AI error explanation logic
β βββ generatePrompt.js # Debugging prompt generator
β
βββ landing_page/ # Landing Page (Separate from Extension)
β βββ Page.html # Marketing page for damn.js
β βββ Page.css # Styling
β βββ vercel.json # Vercel deployment config
β βββ images/ # Assets
β
β **Note:** This is just a landing page for the project.
β It is NOT part of the browser extension functionality.
β
βββ extension/ # Chrome Extension
βββ manifest.json # Extension manifest (V3)
β
βββ icons/
β βββ icon16.png
β βββ icon48.png
β βββ icon128.png
β
βββ scripts/
β βββ injected.js # Injected into page (captures errors)
β
βββ devtools/
β βββ devtools.html # DevTools entry point
β βββ devtools.js # Creates damn.js panel
β
βββ content/
β βββ content.js # Content script (bridges page β extension)
β
βββ panel/ # damn.js Panel UI
βββ panel.html # Panel markup
βββ panel.js # Core panel logic
βββ panel.css # Styling (dark theme)
βββ api-client.js # Backend API calls
βββ utils.js # Helper functions
Note: Timeline and features are flexible and may change
- β Extension architecture
- β Injected script for error capture
- β Content script bridge
- β DevTools panel UI
- β Real-time error display
- β Error filtering
- Backend API setup (Vercel + Express)
- OpenAI/Gemini integration (Gemini focused for now)
- Explain endpoint (error explanations)
- Generate-prompt endpoint (spell generator)
- Error context enhancement
- UI/UX refinements
- Production backend deployment
- Chrome Web Store submission
- Testing on real-world sites
- Documentation
- Framework-specific error detection (React, Vue, Next.js)
- Stack Overflow integration
- Source map awareness
- Minified code decoding
Active Development β Building the MVP with error mirroring and AI integration.
What's Working:
- Extension structure and manifest
- Error capture pipeline (injected script β content script β panel)
- DevTools panel UI with filtering
- Backend API architecture
What's Next:
- Complete AI integration
- Test on real-world applications
- Backend deployment to Vercel
- UI polish and refinements
Expect rapid iteration and frequent changes to code structure, features, and architecture.
- Create DevTools panel
- Capture selected console error text
- Connect to backend API
- Return & display explanation
- Local history system
- Pattern recognition for common errors (CORS, TypeError, 500)
- Better UI layout
- Dark mode sync with DevTools
- Cleaner error parsing
- Source map awareness (stretch goal)
- Enhanced context extraction
- Optional integration with network failures
This repository belongs to my Idea Series β a personal collection of projects that originate from sudden sparks of inspiration.
documenting them keeps the ideas alive and allows them to grow into something real over time.
damn.js emerged from debugging experiences during hackathons and everyday development where console errors slowed down productivity.
The project is under active development and continuous improvement. Features and structure may evolve as development progresses.


