Code GenerationClaude / ChatLLM DeepAgent

Chrome Extension Builder

Build a functional Chrome extension with popup UI, content scripts, and background service worker from a single prompt.

The Prompt

Build a complete Chrome extension.

Extension name: [name]
What it does: [describe the core functionality in 1–2 sentences]
Trigger: [icon click / page load / right-click context menu / keyboard shortcut]
Permissions needed: [e.g., activeTab, storage, scripting]
UI: [popup window / sidebar / floating button / none]

Generate all required files:

1. manifest.json (Manifest V3):
   - Name, description, version
   - Correct permissions
   - Action/popup if needed
   - Content scripts if needed
   - Background service worker

2. popup.html + popup.css:
   - Clean, minimal UI (300px wide)
   - Match extension functionality
   - Status indicators

3. popup.js:
   - Event listeners for UI
   - Message passing to content script
   - Chrome storage for settings

4. content.js (if page interaction needed):
   - DOM manipulation logic
   - Message listener from popup
   - Inject UI elements if needed

5. background.js (service worker):
   - Installation handler
   - Any background tasks

6. README with installation instructions

Write clean, well-commented code. Test with console.log statements in key functions.

Tips for Best Results

  • Load as unpacked extension in chrome://extensions during development
  • Use chrome.storage.sync instead of localStorage for settings that sync across devices

Tags

Chrome extensionJavaScriptbrowser extensionManifest V3productivity

Related Prompts