Build a Chrome extension with Manifest V3 and minimal permissions
Generate a complete browser extension with Manifest V3: a least-privilege manifest.json, service worker, content script, popup, messaging, storage and a Chrome Web Store checklist. Designed for ChatGPT, Claude, Gemini and Microsoft Copilot. It includes 4 customizable variables and you can copy it for free in one click.
Intermediate · Code · Pending editorial review
Prompt
Act as a developer specializing in Chromium-based browser extensions with Manifest V3.
Context:
- What the extension should do: {{purpose}}
- Sites where it works: {{sites}}
- UI and entry points: {{ui}}
- Data it stores and whether it should sync across devices: {{data}}
Deliverables:
1. Architecture: what the service worker, content script and popup or options page do, and how they communicate (chrome.runtime.sendMessage, ports), with a simple diagram.
2. A complete manifest.json with the minimum permissions needed: justify every permission and host_permissions entry; use activeTab or optional_permissions where possible.
3. Code for each file (service worker, content script, popup HTML/CSS/JS, options if needed) in modern JavaScript, with no remote code or eval, respecting the MV3 content security policy.
4. Persistence with chrome.storage (local or sync depending on {{data}}), keeping in mind that the service worker can stop at any time and keeps no in-memory state.
5. Basic popup accessibility (labels, focus, contrast) and strings ready for translation with _locales.
6. How to test it: load unpacked in chrome://extensions, debug the service worker and content script, and test cases.
7. A Chrome Web Store publishing checklist: permission use justification, privacy policy if it handles data, screenshots and icons.
Constraints:
- No data collection or tracking the user did not ask for; if the extension handles personal data, state what must be disclosed in the privacy policy.
- If an API may differ between versions, mark it [VERIFY in the Chrome Extensions docs].
- If it is unclear what the extension should do on each site, ask me first.
Format: numbered sections, a file tree and one code block per file.How to use it
Describe the behavior with a concrete example ("when I select text, right-click and..."). Create the files in a folder, load it as an unpacked extension and test every case before thinking about publishing.
Usage example
Purpose: highlight chosen keywords in yellow on any article · Sites: all, only when the icon is clicked · UI: popup and context menu · Data: synced keyword list.
Sample output
1. Architecture
Only a popup is needed: opening it grants activeTab temporary access to the current tab. No service worker or content script is required, which keeps permissions and attack surface small.
2. manifest.json
{
"manifest_version": 3,
"name": "__MSG_extName__",
"version": "1.0.0",
"default_locale": "en",
"action": { "default_popup": "popup.html", "default_title": "__MSG_saveTitle__" },
"permissions": ["activeTab", "storage"]
}
activeTab: reads the title and URL only when the user clicks the icon.storage: keeps the list inchrome.storage.sync.
3. popup.js
const list = document.querySelector('#list');
async function render() {
const { links = [] } = await chrome.storage.sync.get('links');
list.replaceChildren(...links.map(({ title, url }) => {
const a = Object.assign(document.createElement('a'), { href: url, textContent: title, target: '_blank' });
const li = document.createElement('li');
li.append(a); // textContent: never innerHTML with page data
return li;
}));
}
document.querySelector('#save').addEventListener('click', async () => {
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
if (!tab?.url) return;
const { links = [] } = await chrome.storage.sync.get('links');
if (!links.some((l) => l.url === tab.url)) {
links.unshift({ title: tab.title || tab.url, url: tab.url, savedAt: Date.now() });
await chrome.storage.sync.set({ links });
}
render();
});
render();
Heads-up: storage.sync has a per-item size limit, so a single links key will fill up quickly. Store each link under its own key, or move to storage.local past a certain size [VERIFY quotas in the Chrome Extensions docs]…
Key facts
- Category
- Programming & development · Plugins
- Output type
- Code
- Level
- Intermediate
- Designed for
- ChatGPT, Claude, Gemini and Microsoft Copilot
- Verified in
- Pending editorial verification
- Variables
- Purpose, Sites, UI and Data and sync
- Language
- English
- Price
- Free, no sign-up
- Updated
- Nov 7, 2026
Frequently asked questions
Will it work in Edge, Brave or Opera?
Generally yes, since they are Chromium-based and support Manifest V3, though some APIs or store policies may differ. Test it in each browser before publishing there.
Why request as few permissions as possible?
Broad permissions trigger warnings that scare users away and lengthen Chrome Web Store review. They also limit the damage if the extension ever has a security flaw.
What is this prompt for?
Generate a complete browser extension with Manifest V3: a least-privilege manifest.json, service worker, content script, popup, messaging, storage and a Chrome Web Store checklist.
Which AI tools does it work with?
It is designed for ChatGPT, Claude, Gemini and Microsoft Copilot. We have not verified it in these tools yet, so results may vary between them.
How do I customize the prompt?
Click “Customize” and fill in the variables (Purpose, Sites, UI and Data and sync). The text updates instantly and you can then copy it in one click. Values are stored only in your browser.
Do I need experience to use it?
It is intermediate: it helps to know the topic so you can provide good context and review the result critically.
Is this prompt free?
Yes. Every HomeCasa Prompts prompt is free, with no sign-up or subscription. You can also use them in professional projects.
Can I trust the AI output?
Treat it as a high-quality draft: always check data, figures and important claims before publishing or making decisions.