A Chrome extension is a small bundle of files — a manifest, a background script or service worker, content scripts, a popup or options page, icons, and any web-accessible resources — that Chrome loads to add features to the browser. The manifest is the file that names and wires together all the other parts, so it is the best place to start reading any extension. Everything else in the folder exists to be declared there or called from there.

If you are trying to understand an extension you installed, or building your first one, the anatomy is the same either way: a folder with a manifest at its root and a handful of supporting files around it. This page walks through each part, what it does, and how the parts talk to each other.

The manifest is the extension's table of contents

The manifest is a JSON file named manifest.json that sits at the top level of the extension folder. It holds the extension's name, version, description, icons, and the list of permissions the extension asks for. It also declares which scripts run where: background scripts, content scripts, the popup, and the options page are all registered here.

Chrome reads the manifest first and uses it to decide what to load. If a file is not referenced in the manifest (or loaded by a file that is), Chrome never touches it. That is why a missing entry in the manifest is the usual cause of a feature that silently does nothing.

Permissions are declared in the manifest too, and they matter for what the extension can do. A permission like access to the active tab lets content scripts read and change the page you are on; host permissions name the sites an extension may touch. When you install an extension, Chrome shows these requests before you confirm, so the permission list is a fair summary of what the extension is asking to reach.

Background service worker, content scripts, and the popup

These three parts do most of the visible and invisible work, and each runs in a different place.

The background service worker

The background script runs separately from any web page. In current Chrome it is a service worker: it starts when an event needs it and stops when idle, rather than running forever. It handles browser-level events — a click on the toolbar icon, a keyboard command, an installed or updated event, or a message from another part of the extension. It has no direct access to the page's content; it coordinates.

Content scripts

A content script runs inside the web page itself, in the page's context. It can read and modify the page's HTML and respond to what the user does there. Content scripts are declared in the manifest with a match pattern that says which pages they run on, such as all pages or only a named site. They cannot use most Chrome APIs directly; they pass messages to the service worker instead.

The popup and options page

The popup is the small panel that opens when you click the extension's toolbar icon. It is an HTML page with its own scripts and styles, and it closes as soon as you click elsewhere. The options page is a fuller settings screen, opened from the extension's menu or the extensions page. Both are ordinary web pages running in the extension's context, so they can call Chrome APIs that content scripts cannot.

How the parts of a Chrome extension talk to each other

The parts do not share memory. They communicate by passing messages, and the message path depends on which two parts are involved.

FromToTypical mechanism
Content scriptService workerSend a message; the worker replies
Popup or options pageService workerSend a message or call an API
Service workerContent scriptSend a message to the tab
Any partStored settingsExtension storage API

A common pattern: the popup sends a request to the service worker, the worker decides what to do, and if the page needs changing the worker messages the content script in the active tab. Settings that should survive a browser restart go into extension storage rather than a variable, because the service worker can stop at any time and lose anything held only in memory.

Two practical rules follow. First, do not assume the service worker is running; design it to wake on an event and finish its work quickly. Second, keep messages small and simple — a short object with a type field and a payload is easier to debug than a long chain of calls.

Files, icons, and permissions around the edges

Beyond the scripts, an extension folder usually holds icons at several sizes (commonly 16, 48, and 128 pixels, used for the toolbar, the extensions page, and the store listing), any images or fonts the popup uses, and optional resource files. Files that a web page must be able to load directly — an image injected into a page, for example — have to be listed as web-accessible resources in the manifest.

You can inspect any installed extension's anatomy without special tools. Open the extensions page in Chrome (the address chrome://extensions works in desktop Chrome), turn on developer mode, and each extension shows a details view. From there you can open its folder on disk or inspect its views; the file list you see is the anatomy in front of you. Labels and menu wording can differ slightly by version and platform, so look for the same items under similar names.

If you are building one, the smallest working extension is three files: a manifest, a service worker, and an icon. Load the folder as an unpacked extension from the extensions page, make a change, and reload it there to see the effect. Add a content script only when you need to touch page content, and a popup only when you need a click target.