Black Friday!-$150 off
home

How to Make a Chrome Extension (2026): MV3 Guide

·26 min read

How to make a Chrome extension: a Manifest V3 popup, service worker, content script, and side panel you can load unpacked, then WXT when it should scale.

How to make a Chrome extension in 2026 means a Manifest V3 package: a manifest.json, a popup or a side panel, a service worker, and usually a content script. You can load that folder unpacked from chrome://extensions with no store account. The Chrome Web Store is a later step, and it is the only part that costs money.

Chrome's own hello world stops at a popup that says hello. This guide builds the next useful slice: a popup that remembers a note, a content script that reports the page you are on, a service worker that stores it, and a side panel that stays open. Facts below were read from Chrome's extension docs, WXT's docs, Plasmo's docs, the CRXJS npm readme, and ExtensionPay's site on 25 November 2026.

Publishing is a different job. When the extension works unpacked, use publish a Chrome extension and the Chrome Web Store developer dashboard. Firefox and Edge are separate listings: how to publish a browser extension.

Short answer

Create a folder with manifest.json ("manifest_version": 3), popup.html plus popup.js, background.js as a service worker, and a content script. Set "minimum_chrome_version": "148" and call extension APIs on browser (the same objects as chrome from Chrome 148). Add "storage" if you use browser.storage, and "sidePanel" plus "side_panel.default_path" for a side panel. Open chrome://extensions, turn on Developer mode, and click Load unpacked. Reload the extension after manifest, service worker, or content script edits. Move to a framework (WXT, or Plasmo or CRXJS if you want those layouts) when you want TypeScript, React, and a generated manifest. Publishing needs a Chrome Web Store developer account. A new publisher pays a $5 one-time fee. Building and loading unpacked do not.

Definition: a Chrome extension is a directory of HTML, CSS, JavaScript, and a Manifest V3 manifest.json. Chrome loads it as its own origin (chrome-extension://<id>/). It is not a website users visit, and it is not a userscript pasted into the page.

What a Chrome extension is made of

These are the pieces Chrome's docs actually distinguish. You do not need every row on day one. A popup-only hello world is legal. A production extension usually grows into three or four of them.

PieceManifest keyWhat it isLifetime
Manifestthe file itselfName, version, permissions, and which files existRead on install and on every reload
Popupaction.default_popupSmall HTML page when the user clicks the toolbar icon. Closes when focus leaves it. Size must stay between 25×25 and 800×600Dies when it closes
Service workerbackground.service_workerEvent page. No DOM. No localStorageChrome stops it after 30 seconds idle, or if one request runs longer than 5 minutes
Content scriptcontent_scriptsJavaScript injected into matching pages, in an isolated worldReloaded with the page
Side panelside_panel.default_pathExtension page docked beside the page. Stays open across navigations if you set it that wayStays until the user closes it
Optionsoptions_uiSettings page, embedded on chrome://extensions or in a tabLike any other extension page

Sources: hello world, action, add a popup, service worker lifecycle, content scripts, side panel, options.

A content script can read and change the DOM. It cannot see the page's JavaScript variables, and the page cannot see the content script's. Chrome calls that an isolated world. If you need a title, read document.title in the content script and send a message. Do not reach into the page's JS.

The service worker is the part people treat like a background page from Manifest V2. It is not one. Globals vanish when Chrome terminates it. Put anything you still need in browser.storage (or IndexedDB). Receiving an event or calling an extension API resets the 30 second idle timer. A fetch() that takes longer than 30 seconds to respond also ends the worker. Design the worker so a cold start is normal.

How to make a Chrome extension by hand

The extension below is called Page note. The content script tells the service worker which page you are on. The popup shows that title and a note you can edit. No framework, no bundler, no account.

Put the files in one folder. manifest.json has to sit at the root of that folder, not in a subfolder. JSON comments are invalid and Chrome will refuse the folder.

manifest.json

Chrome's browser namespace guide says a new extension should set minimum_chrome_version to "148" and call browser.*. From Chrome 148, browser.tabs === chrome.tabs. The chrome name is not going away. "148" is the floor for the samples in this post, not a guess about which Chrome your users run. On the store, that key also means Chrome will not deliver this version to anyone still on Chrome 147 or older. They stay on the last build that did not set it.

version is one to four dot-separated integers, each from 0 to 65536. "0.1.0" is valid. A bad version fails the load with that exact rule.

{
  "manifest_version": 3,
  "name": "Page note",
  "description": "Saves a note for the last page you visited.",
  "version": "0.1.0",
  "minimum_chrome_version": "148",
  "action": {
    "default_popup": "popup.html",
    "default_title": "Page note"
  },
  "background": {
    "service_worker": "background.js"
  },
  "content_scripts": [
    {
      "matches": ["https://*/*"],
      "js": ["content.js"]
    }
  ],
  "permissions": ["storage"]
}

content_scripts.matches is where the script is injected. host_permissions is a different key: it lets extension pages (the worker, the popup, the side panel) access those hosts, including fetch() to them. This sample does not fetch other sites, so it does not declare host_permissions. Chrome's declare permissions page lists both, and says changing either can show a warning.

https://*/* is a wide match. Fine for a folder you load yourself. On the store, reviewers ask you to justify broad host access. Narrow the pattern to the sites you actually read, or use activeTab when the user clicks the icon, the context menu, a command shortcut, or an omnibox suggestion. activeTab grants temporary host access for that gesture instead of a permanent host permission. The permissions guide is the checklist we use before a submission.

"storage" is required for browser.storage. Without it, the API calls fail.

The popup is a normal HTML page with one hard rule: JavaScript lives in a separate file. Chrome's popup guide says so. An inline <script> or an onclick attribute will not run.

The popup sizes to its content, inside 25×25 and 800×600. A width on the body keeps a short form from collapsing.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Page note</title>
    <style>
      body {
        width: 280px;
        margin: 0;
        padding: 12px;
        font:
          14px/1.4 system-ui,
          sans-serif;
      }
      textarea {
        width: 100%;
        min-height: 80px;
        box-sizing: border-box;
      }
    </style>
  </head>
  <body>
    <p id="title">No page yet.</p>
    <textarea id="note" placeholder="Note"></textarea>
    <script src="popup.js"></script>
  </body>
</html>
const titleEl = document.querySelector("#title");
const noteEl = document.querySelector("#note");

if (
  !(titleEl instanceof HTMLElement) ||
  !(noteEl instanceof HTMLTextAreaElement)
) {
  throw new Error("Popup markup is missing #title or #note.");
}

const render = (stored) => {
  const page = stored.lastPage;
  if (page && typeof page.title === "string") {
    titleEl.textContent = page.title;
  }
  if (typeof stored.note === "string") {
    noteEl.value = stored.note;
  }
};

noteEl.addEventListener("input", () => {
  browser.storage.local.set({ note: noteEl.value }).catch((error) => {
    console.error(error);
  });
});

browser.storage.local
  .get(["lastPage", "note"])
  .then(render)
  .catch((error) => {
    console.error(error);
  });

storage.local is the area to use here. Chrome's storage reference (read the same day) sets local at 10 MB (QUOTA_BYTES 10485760). unlimitedStorage can raise that. storage.sync is about 100 KB total and 8 KB per item, and it follows Chrome Sync when the user has sync on. A note does not need to sync. Do not use localStorage for this: the service worker cannot read it, and Chrome clears it with browsing history. storage.local stays until the extension is removed.

Service worker

The worker wakes up, handles the message, writes storage, and is allowed to go idle. return true keeps the message channel open until sendResponse runs. That is the pattern Chrome's messaging guide says still works whether or not the newer "return a promise" behavior is enabled. Returning a promise from the listener is documented from Chrome 148, and Chrome says that change is still rolling out. return true is the one to ship.

browser.runtime.onMessage.addListener((message, _sender, sendResponse) => {
  if (!message || message.type !== "page-seen") return;

  const title = message.title;
  const url = message.url;
  if (typeof title !== "string" || typeof url !== "string") return;

  browser.storage.local.set({ lastPage: { title, url } }).then(
    () => sendResponse({ ok: true }),
    (error) => sendResponse({ ok: false, error: String(error) }),
  );

  return true;
});

Validate the message. Chrome's messaging guide is blunt: a content script is less trusted than the service worker, because a compromised page can sit next to it. A string title is page data. It is not a user id, and it is not a reason to call a privileged API. Sign-in is a separate design, covered after the framework section.

Content script

This file runs in the page, in the isolated world, on every https URL you matched. It does not run on chrome:// pages, so do not test it on the extensions page itself. Open any https site.

browser.runtime
  .sendMessage({
    type: "page-seen",
    title: document.title,
    url: location.href,
  })
  .catch((error) => {
    console.error(error);
  });

The .catch matters. If the worker failed to register, sendMessage rejects instead of failing silently. Fix the worker, reload the extension, then reload the tab. The Errors button on the extension card is where a failed registration shows up.

Messages are JSON. Chrome's limit is 64 MiB. undefined becomes null. Functions will not cross.

Load it unpacked

Save the five files in one folder: manifest.json, popup.html, popup.js, background.js, content.js.

Open chrome://extensions. Chrome does not let pages link chrome:// URLs. You can also use the puzzle menu and Manage Extensions, or the Chrome menu, More Tools, Extensions.

Turn on Developer mode. Click Load unpacked and choose the folder that contains manifest.json.

Pin the extension from the puzzle menu. If you shipped no icons, Chrome draws a generic one. That is enough locally. The store listing wants a real 128×128 icon. The prepare and listing rules are the asset list.

Open an https:// page and let it finish loading. Click the toolbar icon. The popup should show that page's title. Type a note, close the popup, and open it again. The note should still be there.

If Load unpacked shows a dialog instead of a card, the manifest failed to parse. The first line of that dialog is the fix. Unknown permission names show up as a red Errors button on the card, not as a failed load. "storage" in the wrong case is a common one: Chrome's debug tutorial shows activetab rejected as "Permission 'activetab' is unknown".

Debug the service worker, the popup, and the content script

Each surface has its own console. Logging in the wrong one is why a "broken" extension is usually fine.

You changedWhat to doWhere the console is
manifest.jsonReload the extension on chrome://extensionsThe load dialog, or the Errors button
Service workerReload the extensionInspect views, the service worker link. Inspecting keeps the worker alive. Close DevTools when you want to test the 30 second shutdown
Content scriptReload the extension, then reload the pagePage DevTools. In the console's context dropdown, pick the extension, not top
Popup or options HTMLRefresh is often enough. The hello world table says these do not require an extension reloadRight-click the open popup, then Inspect. For network calls that finished before DevTools opened, refresh from inside the Network panel

That reload table is Chrome's, from the hello world and the debug tutorial. The service worker link is the blue Inspect views link on the card. If registration failed, that link is missing until the worker parses. Errors on the card records runtime errors plus console.warn and console.error. A content-script typo often does not show there. It shows in the page console, under the extension context.

Editor completion for these APIs is the chrome-types package the hello world tutorial tells you to install. Update it when you update Chrome. It does not change the runtime.

Add a Chrome extension side panel

A popup closes as soon as the user clicks the page. A side panel stays. Chrome has had extension side panels since Chrome 114. The API is browser.sidePanel, and it needs the "sidePanel" permission plus a side_panel.default_path.

Add the permission and the key to the manifest you already have:

{
  "permissions": ["storage", "sidePanel"],
  "side_panel": {
    "default_path": "sidepanel.html"
  }
}

sidepanel.html:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Page note</title>
  </head>
  <body>
    <h1>Page note</h1>
    <p id="title">No page yet.</p>
    <p id="url"></p>
    <script src="sidepanel.js"></script>
  </body>
</html>

sidepanel.js reads the same storage.local keys and updates when they change. storage.onChanged fires in every extension context, including this page.

const titleEl = document.querySelector("#title");
const urlEl = document.querySelector("#url");

if (!(titleEl instanceof HTMLElement) || !(urlEl instanceof HTMLElement)) {
  throw new Error("Side panel markup is missing #title or #url.");
}

const render = (page) => {
  if (!page || typeof page.title !== "string") return;
  titleEl.textContent = page.title;
  urlEl.textContent = typeof page.url === "string" ? page.url : "";
};

browser.storage.onChanged.addListener((changes, area) => {
  if (area !== "local" || !changes.lastPage) return;
  render(changes.lastPage.newValue);
});

browser.storage.local.get("lastPage").then((stored) => {
  render(stored.lastPage);
});

Reload the extension. Open the side panel from Chrome's side panel menu (the icon is your extension's, or a letter if you have no icon). Navigate to another https page. The title should change without you reopening anything.

Toolbar click: popup or side panel, not both at once

The click on the toolbar icon opens action.default_popup when that key is set. Chrome's action reference says action.onClicked does not fire in that case. The side panel sample that opens the panel from the icon does not set default_popup. It sets default_title, then calls:

browser.sidePanel
  .setPanelBehavior({ openPanelOnActionClick: true })
  .catch((error) => {
    console.error(error);
  });

Put that at the top of the hand-rolled service worker if you want the icon to toggle the panel, and remove default_popup. With the popup key gone, the toolbar click no longer opens popup.html. sidePanel.open() (Chrome 116) is the other path, and it only works in a user gesture. The side panel reference and the launch post are the two pages to keep open.

setOptions({ tabId, enabled: false }) hides the panel on sites where it is noise. The reference's example does this for every origin except one. A panel that is open on every site, with nothing to say, is how extensions pick up bad store reviews. Chrome's quality guidelines treat the panel as a companion, not a second browser.

Firefox does not use side_panel. WXT's entrypoints page says a sidepanel file becomes side_panel on Chrome and sidebar_action on Firefox. If you are writing the manifest by hand, that mapping is your job. The Firefox publishing guide is the store half of that port.

When the hand-rolled folder stops scaling

The folder above is the right way to learn the platform, and it is a fine way to ship a small extension you fully own. It gets expensive when you add React, TypeScript, a second browser, and a reload loop you are doing by hand. A framework does not remove Chrome's rules. Permissions, the 30 second worker, and store review stay yours. What it takes is the manifest boilerplate and the dev reload.

Hand-rolledWXTPlasmoCRXJS
What you writeThe files in this postentrypoints/ and wxt.config.ts. No source manifest.jsonpopup.tsx at the project rootA Vite app plus @crxjs/vite-plugin
ManifestYou edit itGenerated from entrypoints and manifest in configGenerated. Their docs say the manifest is abstractednpm readme says zero configuration and Manifest V3
Dev loopReload on chrome://extensions. Popup HTML is the exceptionwxt opens a browser with the extension loadedpnpm dev writes build/chrome-mv3-dev and reloadsReadme says HMR, including content scripts
Other browsersYou port the differenceswxt -b firefox and wxt build -b firefox are in the install docsDocs say multiple browsers and manifest pairsPackage description says Chrome
Use it whenYou want to see every file, or the extension is smallYou want TypeScript, React or Vue, and Chrome plus Firefox from one projectYou want Plasmo's React file layoutYou already have a Vite app and want a plugin, not a new framework

Sources, read 25 November 2026: WXT installation, WXT manifest, WXT entrypoints, Plasmo framework, @crxjs/vite-plugin on npm.

Plasmo is the name a lot of searches use. pnpm create plasmo (npm and yarn work too) gives you a popup.tsx that is a React component, generates icons from icon.png, and pnpm dev loads build/chrome-mv3-dev via Load unpacked. Their getting-started page still lists Node.js 16.14 or later. Treat Plasmo as an alternative SDK with its own file layout, not as a step you have to take after the folder above.

CRXJS is the Vite plugin. The package description is "Build Chrome Extensions with this Vite plugin." The readme says Manifest V3 and HMR. Scaffold with npm create crxjs@latest (the readme says @latest has to be there, or npm may pick a stale cached create script). Pick it when the app is already Vite and you want to keep that toolchain.

WXT is the one this guide walks through next, because the generated manifest, the Firefox flag, and the entrypoint names line up with the files you just wrote. It is also what the TurboStarter extension is built with. That is a stack choice, not a claim that the others fail.

React and TypeScript with WXT

WXT's install docs: pnpm dlx wxt@latest init (or npx wxt@latest init). The starters are TypeScript. JavaScript is the same files with the extensions changed. For an existing folder, pnpm i -D wxt, then scripts:

{
  "scripts": {
    "dev": "wxt",
    "dev:firefox": "wxt -b firefox",
    "build": "wxt build",
    "build:firefox": "wxt build -b firefox",
    "zip": "wxt zip",
    "postinstall": "wxt prepare"
  }
}

wxt prepare writes .wxt/tsconfig.json. Your tsconfig.json should extend it. Do not put path aliases in that tsconfig yourself. WXT's TypeScript page says to add aliases in wxt.config.ts, or the bundler and the generated config drift.

React is a module, not a fork of WXT. From the frontend frameworks page:

import { defineConfig } from "wxt";

export default defineConfig({
  modules: ["@wxt-dev/module-react"],
  manifest: {
    name: "Page note",
    description: "Saves a note for the last page you visited.",
    minimum_chrome_version: "148",
    permissions: ["storage"],
  },
});

There is still no manifest.json in source. name falls back to package.json if you omit it. version is taken from package.json (version_name keeps a pre-release suffix, version is the cleaned string). A sidepanel entrypoint adds the side panel permission. You still list storage yourself. Host permissions go in the same manifest object as host_permissions.

Entrypoints are one level under entrypoints/. entrypoints/popup/index.html, entrypoints/background.ts, entrypoints/content.ts, entrypoints/sidepanel/index.html. Deeper nesting is ignored. Do not drop popup.ts next to popup.html in entrypoints/. WXT will try to build both as entrypoints.

entrypoints/background.ts:

import { browser } from "wxt/browser";

export default defineBackground(() => {
  browser.runtime.onMessage.addListener((message, _sender, sendResponse) => {
    if (!message || message.type !== "page-seen") return;
    if (typeof message.title !== "string" || typeof message.url !== "string") {
      return;
    }

    const title = message.title;
    const url = message.url;

    browser.storage.local.set({ lastPage: { title, url } }).then(
      () => sendResponse({ ok: true }),
      (error: unknown) => sendResponse({ ok: false, error: String(error) }),
    );

    return true;
  });
});

WXT imports this file in Node during the build. Runtime calls have to live inside main (the function form above). A browser call at the top of the file runs at build time and fails. defineBackground and defineContentScript are provided in entrypoint files. browser is the import from wxt/browser. At runtime it is globalThis.browser or globalThis.chrome. Auto-import can remove the import line. The samples keep it so the file is explicit.

entrypoints/content.ts:

import { browser } from "wxt/browser";

export default defineContentScript({
  matches: ["https://*/*"],
  main() {
    browser.runtime
      .sendMessage({
        type: "page-seen",
        title: document.title,
        url: location.href,
      })
      .catch((error: unknown) => {
        console.error(error);
      });
  },
});

A React popup is entrypoints/popup/index.html with <div id="root"> and <script type="module" src="./main.tsx">, plus:

import { useEffect, useState } from "react";
import { browser } from "wxt/browser";

export const App = () => {
  const [title, setTitle] = useState("No page yet.");
  const [note, setNote] = useState("");

  useEffect(() => {
    void browser.storage.local.get(["lastPage", "note"]).then((stored) => {
      const page = stored.lastPage as { title?: unknown } | undefined;
      if (typeof page?.title === "string") setTitle(page.title);
      if (typeof stored.note === "string") setNote(stored.note);
    });
  }, []);

  return (
    <>
      <p>{title}</p>
      <textarea
        value={note}
        onChange={(event) => {
          const next = event.target.value;
          setNote(next);
          void browser.storage.local.set({ note: next });
        }}
      />
    </>
  );
};

pnpm dev is the loop. pnpm zip is the package you upload. The zip still has to have manifest.json at its root, which WXT's output does. The Chrome publishing docs assume that layout.

Auth and getting paid

The Page note extension does not know who the user is. A SaaS extension does. The login should happen on your site, and the extension should inherit that session, then call the same API as the web app. Password fields inside a popup are a good way to fail review and to leak a credential into a page you do not control. The setup we ship is documented in extension auth and extension billing: checkout stays on the web, the extension reads the plan. The architecture for one backend across web, mobile, and the extension is cross-platform SaaS.

Chrome will not charge the user for you. Two official statements, and one place the old page has gone:

  • The developer agreement (updated 4 May 2021) says if you charge a fee, you are responsible for the transactions, and Google does not track or process those payments. The same agreement says you may offer an extension as an access point to a paid service the user already bought.
  • Google's Chrome Web Store payments deprecation doc (source still in the developer.chrome.com repo, dated 20 September 2020) says new paid items and in-app products stopped on 21 September 2020, and existing Chrome Web Store charges stopped on 1 February 2021. The published URL for that doc returned 404 on 25 November 2026, so treat the repo file as the timeline and the live agreement as the rule that still binds you.

ExtensionPay describes itself as an open-source library (ExtPay.js) that opens a payment page and checks a paid flag through its servers, with Stripe as the processor. Their site, read the same day, lists a 5% transaction fee and no monthly fee on that plan, and says high-volume rates are a conversation, not a posted price. That is their pricing page, not a quote from us. If you already have billing on the web app, you do not need a second processor inside the extension. The extension is the client.

Publish it when it is ready

Loading unpacked is not publishing. A public install needs a developer account, a zip, a listing, privacy answers, and a review.

Register at the Chrome Web Store developer dashboard. The register guide says the fee is one-time and does not print the amount. Google's 28 April 2026 dashboard post says creating a new publisher still includes a $5 registration fee. People you invite onto an existing publisher do not pay it again. The same figure is in the What's New note from 30 April 2026.

The walkthrough for the zip, the screenshots, and review time is how to publish a Chrome extension. The screen-by-screen dashboard tour is the developer dashboard guide. Firefox and Edge are not the same upload: Firefox on addons.mozilla.org, Edge Add-ons, and the three-store comparison in how to publish a browser extension. Kit-specific GitHub Actions live in the Chrome, Firefox, and Edge docs.

Manifest V2 is not a fallback. Chrome's support timeline says the store stopped accepting new public and unlisted MV2 extensions in January 2022, and new private ones in June 2022. Chrome 138 (24 July 2025) disabled MV2 for everyone, with no toggle. On 31 August 2026 the remaining MV2 items were removed from the store. Existing installs on Chrome 138 or earlier can still run, and they cannot be updated or reinstalled from the store.

Where a starter kit fits

Hand-rolled is how you learn the runtime. A starter kit is how you skip rebuilding auth, billing, and the store zip for the third time.

TurboStarter's extension is a WXT + Vite app in the same repo as the web app and the mobile app. One backend, one session, ownership of the code. The extension stays thin: popup, side panel, content scripts, and the service worker call the API. They do not grow a second user table. That split is the extension docs and the WXT + Vite boilerplate. Which kit includes the extension is which kit to choose. Pricing is on the pricing page.

You do not need the kit to finish this tutorial. Load the folder. If the next requirement is "the same user as the website", start from the kit instead of gluing a login form into popup.html.

Ship the extension with the same backendCore Kit is the WXT extension, the web app, and the mobile app on one backend.
Try TurboStarter

FAQ

Ship the folder, then decide

How to make a Chrome extension is a small directory you can load today: Manifest V3, a popup, a service worker that is allowed to die, a content script in an isolated world, and a side panel if the UI should stay open. Use browser and minimum_chrome_version "148" so the calls match current Chrome docs. Keep permissions narrow. Put state in browser.storage.local, not in a global and not in localStorage.

Stay in that folder while it is teaching you something. When the same product needs React, Firefox, and the user who already signed in on the website, generate the manifest with WXT and keep the extension as a client of the backend you already run. The store is the step after the unpacked folder works, not the step before.

world map
Community

Connect with like-minded people

Join our community to get feedback, support, and grow together with 1,000+ builders on board, let's ship it!

Join us

Ship your startup everywhere. In minutes.

Don't burn tokens on setup and start building features on day one.

Get TurboStarter