Building A Chrome Extension In 2021
A step-by-step guide to launching your own Chrome extension using JavaScript.

Search for a command to run...
A step-by-step guide to launching your own Chrome extension using JavaScript.

Great tutorial.
Thank you Andrew Baisden!
Awesome guide, Nischal! I've actually been putting off creating a specific Chrome extension idea I've had, so this will help me get started. Mine will likely require user accounts, database, and some minimal storage, all for which I plan to utilize AppWrite.
With that in mind, do you plan to release a part 2 or 3 covering deeper concepts such as incorporating React into your Chrome extension, linking it to a database or storage? Even using AppWrite in your example may be a really great fit.
That's interesting stuff Brandon! I'll definitely give it more thought to release the next parts.
Meanwhile, you can check out this project where I've doubled-down on using React/storage in a Chrome extension.
Good luck!
Is the local IDE dead? Sanket Sahu discusses the rise of 'vibe-coding' and how browser-native tools like RapidNative are reshaping the future of mobile app development.

OpenClaw is a powerful, self-hosted AI assistant that connects to your tools to perform actions. Explore its Gateway architecture, real-world use cases, and security precautions.

Discover how neo-brutalism is shaping 2026 design trends. See how anti-design principles can create distinct, usable, and memorable product experiences.

When code breaks a pipeline, developers have to stop working and figure out why. This blog shows how an AI agent reads the error, finds the fix, and submits it for review all on its own.

GeekyAnts built a 5-agent fraud detection pipeline that makes decisions in under 200ms — 15x cheaper than single-model systems, with full explainability built in.

GeekyAnts Tech Blog
349 posts
GeekyAnts is an AI-powered digital product engineering and consulting company helping startups, enterprises, and Fortune 500 brands build scalable, future-ready digital solutions. Since 2006, we have delivered 800+ successful projects for 550+ global clients across healthcare, BFSI, retail, logistics, education, and enterprise technology. We help businesses accelerate digital transformation through strategy, design, engineering, and AI-led innovation.
A huge part of what makes Chrome such a widely-used product is how expandable it is and Chrome extensions have had a huge role to play in this expansion. There's a Chrome extension for anything and everything in this world and what's great is that it's remarkably easy to build one by yourself.
In this article, we'll be creating a Chrome extension from scratch and go all the way to publishing it to the Chrome web store. We'll also be keeping everything as per the Manifest V3(MV3) framework while building our extension.
Here's a representation of what we're going to build:

We've all been pretty obsessed with cryptocurrencies lately, many times we find ourselves constantly checking the market trends just to stay updated. Wouldn't it be great if we could build a Chrome extension that gives us the latest price whenever we open the extension?
Let's get on with the building part then!
Before we start building, it would be great if we could get a sense of what exactly is a Chrome extension and how it works under the hood in a browser. On a basic level, an extension is just a collection of HTML, CSS and JavaScript snippets that lets us execute some extra functionalities through the JavaScript APIs that the Chrome browser exposes. In layman's terms, an extension is mostly a webpage hosted inside Chrome with access to some specific APIs.
In this blog, we're going to walk you through creating a basic Chrome extension called CryptoBase. This kind of extension fires a browser notification based on the fulfilment of specific business logic inside our extension and optionally execute some Javascript.
There are also a few terms you'll need to get accustomed to before we begin.
Chrome extensions start with a manifest.json file. You can run code in the background using the background service worker. Any code specific webpage can be run through a content scripts file while the Options file is used to help the users customise the extension by providing an options page by right-clicking the extension icon in the toolbar and finally, the main UI element of our Chrome extension will be built using the popup file.
CryptoBase
├── icon-32.png
├── popup.html
├── popup.css
├── popup.js
└── background.js
CryptoBase. We'll be keeping all our files in this new folder. Chrome does allow us to load and test our extensiona by pointing to a specific folder that contains all the files.manifest file for our extension to run as it tells Chrome everything needs to properly load in our Chrome extension. We'll create a blank manifest.json file and put it into the same root folder called CryptoBase that we created earlier.16x16px, 32x32px, 48x48px and 128x128pxor go for a single default size to cover all devices.popup files in our extension by creating HTML, CSS and JS files for the popup in our CryptoBase directory.You can get the complete setup here from the Chrome Developers' documentation.
manifest.json file which describes our extension to the browser. Use the snipper given below: "name": "Cryptobase",
"description": "Cryptobase",
"version": "1.1",
"manifest_version": 3,
"permissions": [],
"host_permissions": [],
"background": {
"service_worker": "background/background.js"
},
"action": {
"default_title": "Cryptobase",
"default_icon": "assets/icon-32.png",
"default_popup": "popup/popup.html"
},
"icons": {
"16": "assets/icon-16.png",
"32": "assets/icon-32.png",
"48": "assets/icon-48.png",
"128": "assets/icon-128.png"
},
"key": "MIIBIjANBgk..."
1. Creating the user interface.
popup.html should look like: <!doctype html>
<html>
<head>
<link rel="stylesheet" href="popup.css" />
</head>
<body>
<main>
<div class="container">
<h1 class="heading">CryptoBase</h1>
<h3 class="sub-heading">Chrome extension for cryptocurrencies.</h3>
<div id="main-content"></div>
</div>
</main>
<script src="popup.js"></script>
</body>
</html>
popup.css and popup.js. These are where we'll be putting our logic for our extension that'll execute whenever its icon is clicked.2. Building the logic.
const baseCoinAPI = "https://pro-api.coinmarketcap.com/";
const apiVersion = "v1";
const apiKey = `&CMC_PRO_API_KEY=${REACT_APP_CMC_KEY}`;
//Function to get the top 25 coins.
const getCoins = async (endPoint) => {
let path = `${baseCoinAPI}${apiVersion}${endPoint}${apiKey}`;
const fetchResult = await fetch(path);
const result = await fetchResult.json();
if (fetchResult.ok) {
return result;
}
const responseError = {
type: "Error",
message: result.message || "Something went wrong",
data: result.data || "",
code: result.code || "",
};
let error = new Error();
error = { ...error, ...responseError };
throw error;
};
//DOM Manipulation to show all the coins and respective values
const coins = getCoins("/cryptocurrency/listings/latest?limit=25");
var mainContent = document.getElementById("main-content");
if (coins.length > 0) {
coins.forEach((coin) => {
var content = document.createElement("div");
var paragraph = document.createElement("p");
paragraph.textContent = `${coin.name} - ${coin.quote.USD.price}`;
content.appendChild(paragraph);
mainContent.appendChild(content);
});
}
Before publishing our extension to the Chrome Web Store, we need to get it reviewed from Chrome. Here are a few things we need to do to before submitting our extension for review.
1. Creating a zip file of our extension.
In order to upload the extension to the Chrome Web Store, we'll need to create a zip file that contains all the required files, assets and most importantly manifest file in the root directory.
2. Setting up a developer account.
We also need to create a Chrome Web Store developer account in order to publish the extension. Here's what it should look like:

3. Uploading the extension.
Let's finish uploading the extension by following these steps below:
i. Go to the Chrome Developer Dashboard.
ii. Sign into the developer account we created earlier.
iii. Click the Add new item button.
iv. Click Choose file > our zip file > Upload. If our manifest and zip file are valid, we can edit the extension on the next page.
4. Add assets for our listing
We can add multiple assets for our extension on the Chrome Web Store. These include Screenshots and Promo tile amongst many other things. We could also create a separate webpage to tell users more about our extension.
5. Submit item for publishing
Once we've uploaded our extension, we can see it as an item in our dashboard. Here's what this should look like:

After the extension is uploaded for review, it will go through a review process. The time taken for this review to finish depends on the nature of the item. Here's the result:

Now we've got a fully functional, albeit simple, Chrome Extension which can be accessed by anyone within the Chrome Web Store.
There are tons of areas where you can experiment with these extensions and perhaps use this as a building block to making something new, all by yourself. Use animations, add new scripts for things like popups, background, etc. There's a whole lot more you can do.
Go for it. :)
And that's it! We now have a working Chrome extension. If you found this post useful, show us the ❤️ and also feel free to reach out in the comment section.