A Chrome extension is a small program that adds features to the browser. If you have an idea such as "save this page to my notes" or "show prices in my currency", an extension can be a good way to build it. This guide shows the basic steps. It follows Google's own getting-started tutorial, linked at the end.
What an extension is made of
The only required file is manifest.json. It sits in the root folder of your extension and describes what the extension is and what it can do (Chrome manifest reference). Everything else, such as a popup page, icons, scripts and styles, is optional and depends on what your extension does.
Use Manifest V3
Chrome's current extension format is Manifest V3. In manifest.json this is written as "manifest_version": 3. Google's guide notes that the Chrome Web Store no longer accepts Manifest V2 extensions (Chrome get-started docs), so a new extension should use V3 from the start.
Step 1: create a folder and a manifest
Make a new folder, and inside it create manifest.json. Google's Hello World example has a name, a version, manifest_version: 3, and an action entry that points to a small HTML page (the popup) and an icon (Hello World tutorial).
Step 2: add the popup
Create the HTML file that the action entry points to. When someone clicks the extension's icon in the toolbar, Chrome shows this page. For a first extension it can be a few lines of text.
Step 3: load it into Chrome
- Open
chrome://extensionsin Chrome. - Turn on Developer mode.
- Click Load unpacked and choose your folder.
Your extension now appears in the toolbar. After you change the manifest, go back to chrome://extensions and reload the extension, because saving the file alone does not update it (Hello World tutorial).
Step 4: make it do something useful
Once the basics work, choose the part of the browser your idea needs to touch. Google's tutorials show several patterns:
- Inject a script into the page you are on, for example to change how a page looks (scripts in the active tab).
- Run a script on every page that matches a pattern (scripts on every tab).
- Use a service worker in the background to react to browser events (get started overview).
Keep permissions small
An extension must ask for permission to do things such as read a page. Ask only for what you need. Broad permissions also tend to make the store review slower (see our guide on publishing a Chrome extension).
When to ask for help
A simple extension with one job is a good first project. If your idea needs accounts, payments, a server, or a version for more than one browser, it is worth planning the pieces before you start. We build browser extensions from idea to store listing. You can build a price estimate or send us a short brief, and the consultation is free.
