---
title: "Build a Chrome extension with AI, step by step"
description: "From idea to Chrome Web Store: Manifest V3, a copy-paste prompt, loading it locally, keeping permissions narrow and the publishing rules to follow."
url: "https://vibe-code.blog/en/chrome-extension-ai"
lang: "en"
author: "Thierry Gustin"
published: "2026-11-27"
updated: "2026-11-27"
---

# Build a Chrome extension with AI, step by step

> **Key takeaways** — To build a Chrome extension with AI, describe one precise function, ask for a Manifest V3 extension with minimal permissions, load the folder in developer mode at chrome://extensions, test it, then publish to the Chrome Web Store after paying a one-time registration fee. Since 2025, only Manifest V3 extensions run in Chrome, and all code must ship inside the package.

Building a Chrome extension with AI is one of the most approachable vibe coding projects: a handful of files, no server, and something usable the same day. You describe the function, the AI writes the `manifest.json` and the JavaScript, you load the folder into Chrome in developer mode and test it. This tutorial covers the six steps, from spec to Chrome Web Store, with Google's rules as of November 21, 2026.

## What is a Chrome extension, really?

A Chrome extension is a folder of web files (HTML, CSS, JavaScript) described by a `manifest.json` file. The manifest tells Chrome the extension's name, version, permissions and which files to load.

The parts you will meet most often:

| Part | Role | Typical use |
| --- | --- | --- |
| `manifest.json` | ID card and permissions | Required |
| Popup (`action`) | Small window when you click the icon | Form, button, result |
| Content script | Code injected into a web page | Read or change the page |
| Service worker | Background code | Context menus, alarms |
| Options page | Extension settings | Preferences |

With Manifest V2 gone, only version 3 matters. According to [Google's official timeline](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline), MV2 extensions were disabled for all users with Chrome 138 on July 24, 2025, and the last ones were removed from the Chrome Web Store on August 31, 2026. If the AI suggests `"manifest_version": 2`, say no.

## Step 1: pick one useful function

The best extension does one thing clearly. That is also a Chrome Web Store rule: an extension must have a single purpose that is narrow and easy to understand, and two clearly separate features belong in two extensions, per the [Chrome Web Store Program Policies](https://developer.chrome.com/docs/webstore/program-policies/policies).

Realistic ideas:

- Copy the current tab's title and URL as Markdown in one click.
- Highlight words from a list on any page (competitors, legal terms).
- Count the words in selected text.
- Fill an email reply template from details visible on a page.
- Show a Pomodoro timer in the toolbar.

For more everyday tools, see [automating your business with small vibe-coded tools](https://vibe-code.blog/en/automation-vibe-coding), and the pillar article on [25 real vibe coding use cases](https://vibe-code.blog/en/vibe-coding-use-cases) widens the scope.

## Step 2: write the extension prompt

The prompt must lock in Manifest V3, minimal permissions, the file structure and how to test. A copy-paste template:

```text
Build a Chrome extension using Manifest V3.

Single function: when I click the icon, the popup shows the
active tab's title and URL as Markdown [Title](URL), with a
"Copy" button that puts the text on the clipboard and shows
"Copied" for 2 seconds.

Technical constraints:
- Minimal permissions: use "activeTab", no host_permissions,
  no "<all_urls>".
- All code inside the package: no libraries loaded from a CDN,
  no remote scripts.
- No data sent to any server.
- Files: manifest.json, popup.html, popup.js, popup.css,
  and 16, 48 and 128 px icons (generate simple PNGs).
- Comment the code in plain English.

Deliver: the folder tree, the content of each file, then the
steps to load the extension in developer mode and test it.
```

The structure follows [the 5-step method for vibe coding prompts](https://vibe-code.blog/en/vibe-coding-prompts). With a coding agent like [Claude Code](https://www.anthropic.com/claude-code) or [Cursor](https://cursor.com/), the AI creates the files directly in a folder. With a regular chat, you copy each file by hand into an empty folder.

### What does a minimal manifest look like?

Here is the basic shape from [Google's Hello World tutorial](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world):

```json
{
  "name": "Hello Extensions",
  "description": "Base Level Extension",
  "version": "1.0",
  "manifest_version": 3,
  "action": {
    "default_popup": "hello.html",
    "default_icon": "hello_extensions.png"
  }
}
```

Every file named in the manifest must exist in the folder, or Chrome refuses to load the extension.

## Step 3: load the extension locally

You can test an extension without publishing it, in three clicks. The official steps from [Google's tutorial](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world):

1. Open `chrome://extensions` in a new tab.
2. Turn on the **Developer mode** toggle.
3. Click **Load unpacked** and select your folder.

After each change, click the extension's reload icon in `chrome://extensions`. The manifest and the service worker need that reload; the popup and options page update when you reopen them.

## Step 4: keep permissions narrow

The fewer permissions your extension asks for, the more people trust it and the faster it clears review. Chrome shows install-time warnings for some permissions and for any site-access pattern, per the [documentation on declaring permissions](https://developer.chrome.com/docs/extensions/develop/concepts/declare-permissions).

- **`activeTab`** grants temporary access to the current tab, only after a user gesture (clicking the icon), and shows no warning at install, according to the [activeTab page](https://developer.chrome.com/docs/extensions/develop/concepts/activeTab). Access ends when the user navigates away or closes the tab.
- **`host_permissions`** grants access to specific sites. Limit it to the domains you truly need.
- **Optional permissions** are requested at runtime instead of at install. Google recommends them wherever the feature allows.

> **Be wary of ""** — AI often adds `<all_urls>` or `*://*/*` "to make it work". Those patterns give access to all web activity and lengthen review, according to the [review process page](https://developer.chrome.com/docs/webstore/review-process). Ask the AI to justify every permission.

## Step 5: test and debug

Test the extension on several sites and edge cases: empty tab, a `chrome://` page, a very long page, a slow connection. `chrome://` pages are off limits by design: `activeTab` grants no access there.

Three debugging habits:

- **Popup**: right-click inside the popup, then "Inspect" to open the console.
- **Service worker**: the "service worker" link on the extension's card in `chrome://extensions`.
- **Errors**: the "Errors" button on the same card. Paste the exact message into the AI chat.

One trap keeps coming back with generated code: Chrome stops the service worker after 30 seconds of inactivity, and every global variable is lost, according to the [service worker lifecycle docs](https://developer.chrome.com/docs/extensions/develop/concepts/service-workers/lifecycle). Values must be saved with the `chrome.storage` API. The [storage API reference](https://developer.chrome.com/docs/extensions/reference/api/storage) lists the limits: 10 MB for `storage.local`, about 100 KB for `storage.sync`, with 8 KB maximum per item.

For a testing method that does not require being a developer, read [testing AI-generated code](https://vibe-code.blog/en/testing-ai-generated-code). And before every big change, commit: [Git for vibe coders](https://vibe-code.blog/en/git-for-vibe-coders) shows how to never lose a working version.

## Step 6: publish on the Chrome Web Store

Publishing goes through the Chrome Web Store developer dashboard. Before publishing, you must register as a developer and pay a one-time registration fee, per the [official registration page](https://developer.chrome.com/docs/webstore/register). Google set that fee at $5, as [9to5Google reported in 2020](https://9to5google.com/2020/03/12/chrome-web-store-fee/); the official page does not state the amount, which appears when you register.

The pre-submission checklist:

1. A clear description of the single purpose, with screenshots.
2. Icons in the right sizes.
3. A privacy policy if the extension handles user data: the Chrome Web Store policies require one for any product that handles user data.
4. No remote code: in Manifest V3, all logic must be part of the package and remotely hosted files can no longer be loaded, per [Google's MV3 security page](https://developer.chrome.com/docs/extensions/develop/migrate/improve-security).
5. No secret API keys in the code: an extension is a package anyone can unzip. See [why API keys must never live in your front end](https://vibe-code.blog/en/api-keys-security).

On timing, most extensions are reviewed within a few days, but it can take a few weeks; past three weeks, Google suggests contacting support, according to the [review process page](https://developer.chrome.com/docs/webstore/review-process). New developers, sensitive permissions and large codebases lengthen review.

## Which AI tool should you use to code an extension?

A chat is enough for a three- or four-file extension. A coding agent pays off once you have a content script, a service worker and options, because it edits several files at once and keeps them consistent. The [Cursor vs Claude Code vs Codex comparison](https://vibe-code.blog/en/cursor-vs-claude-code-vs-codex) details the differences, and the [Cursor review](https://vibe-code.blog/en/cursor-review) explains how it works inside the editor.

## Frequently asked questions

### Do I need to code to build a Chrome extension with AI?

Not for a simple extension. The AI writes the manifest and the JavaScript from a precise description, and loading it in developer mode takes three clicks. You do need to read an error message in `chrome://extensions`, check the permissions requested and test on several sites before sharing the extension with anyone.

### How much does it cost to publish on the Chrome Web Store?

Google charges a one-time registration fee to become a Chrome Web Store developer. That fee was set at $5, according to Google's announcements reported in 2020; the official registration page does not state the amount, which appears in the dashboard. There is no annual subscription, unlike Apple's Developer Program.

### Can I use an extension without publishing it?

Yes. In developer mode, Chrome loads the extension from a local folder with the "Load unpacked" button. That is the right option for a personal tool or for testing. To share it with a team or the public, publishing on the Chrome Web Store remains the normal path.

### Why does my extension lose its data?

Most often, the code keeps values in global variables inside the service worker. Chrome stops that service worker after 30 seconds of inactivity and the variables vanish. Ask the AI to save values with `chrome.storage.local` (10 MB) or `chrome.storage.sync` (about 100 KB, synced across devices), after declaring the `storage` permission.

### Why is my extension review taking so long?

Most extensions are reviewed within a few days, but some signals lengthen the wait: new developer, new extension, sensitive permissions, access to all sites, a large or hard-to-read codebase. Cut permissions to the strict minimum and avoid minified code. Past three weeks, contact developer support.

## Sources

- [Hello World extension — Chrome for Developers](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world)
- [Manifest V2 support timeline — Chrome for Developers](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline)
- [Chrome Web Store Program Policies — Chrome for Developers](https://developer.chrome.com/docs/webstore/program-policies/policies)
- [Declare permissions — Chrome for Developers](https://developer.chrome.com/docs/extensions/develop/concepts/declare-permissions)
- [The activeTab permission — Chrome for Developers](https://developer.chrome.com/docs/extensions/develop/concepts/activeTab)
- [The extension service worker lifecycle — Chrome for Developers](https://developer.chrome.com/docs/extensions/develop/concepts/service-workers/lifecycle)
- [chrome.storage API — Chrome for Developers](https://developer.chrome.com/docs/extensions/reference/api/storage)
- [Improve extension security — Chrome for Developers](https://developer.chrome.com/docs/extensions/develop/migrate/improve-security)
- [Register your developer account — Chrome for Developers](https://developer.chrome.com/docs/webstore/register)
- [Chrome Web Store review process — Chrome for Developers](https://developer.chrome.com/docs/webstore/review-process)
- [Chrome Web Store requiring up-front registration fee — 9to5Google](https://9to5google.com/2020/03/12/chrome-web-store-fee/)

— Thierry Gustin, Formateur en intelligence artificielle (GustinAI) · November 27, 2026
