Build your first Chrome extension
Highlight anything on the web, right-click, and it's saved to your own notes, ready to copy as Markdown. Build it from scratch in plain JavaScript, with real Manifest V3 code and no build tools, for Chrome and Edge. Then grow it into a page summariser that runs on a free local AI.
- A clear picture of permissions, privacy and what publishing to the Chrome Web Store involves, before you spend anything
- A ready-made prompt to grow it into a "summarise this page" extension powered by a free AI on your own PC
- Google Chrome or Microsoft Edge, up to date. Both use the same extension system, so everything here works in either.
- A code editor. Any will do; VS Code ↗ is free and highlights mistakes in JSON and JavaScript.
- Basic comfort with files and folders in the terminal. If
mkdirandcdare new, do the Terminal survival kit first. - No accounts, no Node.js, no build tools. An extension is just a folder of HTML, CSS and JavaScript.
- Optional, only if you publish: a Google account and the Chrome Web Store's one-off US$5 developer fee (shown on Chrome for Developers ↗; fees can change, so check there).
Make the folder, write a manifest, load it into Chrome
Every extension starts with manifest.json: a small file that tells the browser what the extension is called, what's in it and what it's allowed to do.
See the finished thing first (2 minutes)Download the starter kit, read-and-keep.zip, and unzip it. Go to
chrome://extensions(type it into the address bar), turn on Developer mode at the top right, click Load unpacked and choose the unzippedread-and-keepfolder. Highlight a sentence on any article, right-click it and choose Save "..." to notes, then pin the extension from the puzzle-piece menu and open its popup: your note is there, and the badge on the icon counts it. That's what you're about to build. Click Remove on its card before you load your own, or you'll get two right-click items.Now build it yourself. Make a folder for the project with an
iconsfolder inside it:Windowsmkdir "$HOME\Documents\read-and-keep\icons" cd "$HOME\Documents\read-and-keep"Mac / Linuxmkdir -p ~/Documents/read-and-keep/icons cd ~/Documents/read-and-keepCopy the four PNGs from the kit's
iconsfolder into your owniconsfolder. Keep the rest of the kit to check your work against. You'll type the code yourself, one piece at a time, so you know what every line does.Now create
manifest.jsonin theread-and-keepfolder:manifest.json{ "manifest_version": 3, "name": "Read & Keep", "version": "0.1.0", "description": "See how long a page takes to read, and save the bits you highlight as notes. Everything stays in your browser.", "icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", "48": "icons/icon48.png", "128": "icons/icon128.png" }, "action": { "default_title": "Read & Keep", "default_popup": "popup.html", "default_icon": { "16": "icons/icon16.png", "32": "icons/icon32.png" } } }manifest_version: 3is the current extension format (Manifest V3). The only value Chrome accepts now is 3.name(75 characters max) anddescription(132 max) show on the extensions page and in the store.iconsare for the extensions page and the store.actionis the button in your toolbar: its icon, its hover text and the page that opens when you click it (the popup).
Create
popup.htmlnext to it. This is a throwaway hello page; you'll replace it in step 3:popup.html<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Read & Keep</title> </head> <body style="width: 240px; font: 14px system-ui, sans-serif"> <p>Hello. My first extension works.</p> </body> </html>Now load it. In Chrome, go to
chrome://extensions(type it into the address bar; it isn't a clickable link). Turn on Developer mode in the top-right corner, click Load unpacked and choose yourread-and-keepfolder. In Edge, the same page isedge://extensions, with the same Developer mode toggle and Load unpacked button.Click the puzzle-piece Extensions button in the toolbar and pin Read & Keep, so its icon sits next to the address bar. Then click the icon.
Tip"Unpacked" means Chrome runs the extension straight from your folder. Edit a file, reload, and the change is live. It's how every extension is developed before it's ever published.
chrome://extensions with its orange icon, and clicking the toolbar icon opens a small box saying Hello. My first extension works.If it breaks'Manifest file is missing or unreadable' + 3 more
'Manifest file is missing or unreadable'
manifest.json directly inside it, not the folder above it. Also check the file isn't secretly called manifest.json.txt: in Windows Notepad, set Save as type to All files, or turn on file name extensions in File Explorer's View menu.'Manifest is not valid JSON'
'Could not load icon'
icons folder sits inside read-and-keep and holds icon16.png, icon32.png, icon48.png and icon128.png.