
A Chrome extension is a small program that adds features to the browser: a button that summarizes a page, a tool that hides distractions, a password manager or a color picker. The good news for learners is that extensions are built with the web technologies you already know, HTML, CSS and JavaScript, plus one configuration file. You do not need a special compiler or an expensive account to start.
Google added extensions to Chrome at the end of 2009, and the Chrome Web Store opened in 2010. The rules of an extension are described by its manifest, and the platform has gone through several versions. Manifest V3 was introduced in 2021 to make extensions safer, faster and more private. Chrome phased out the older Manifest V2 between 2024 and 2025, so every new extension must use Manifest V3. Many older tutorials still show V2 code that no longer works. The same extension format also runs in Microsoft Edge, Brave and Opera, and largely in Firefox.
Create a folder, for example my-extension, and add a file named manifest.json. A minimal version needs only a few keys:
JSON is strict: use double quotes and no trailing commas. A single typo stops the extension from loading, and Chrome shows the error on the extensions page.
Create popup.html with ordinary HTML, for example a heading and a button, and link a stylesheet and a script with <script src="popup.js"></script>. One important rule: Manifest V3 does not allow inline JavaScript. Code inside a <script> tag or an onclick attribute is blocked by the content security policy. Put all code in separate files and attach events with addEventListener. Keep the popup small, around 300 to 400 pixels wide, because it closes as soon as the user clicks elsewhere.
After every change, click the reload icon on the extension's card. To debug the popup, right-click it and choose Inspect; this opens the familiar DevTools with a console. The service worker has its own Inspect views link on the card.
To modify pages, declare a content script in the manifest under "content_scripts", with a "matches" list such as "https://*.example.com/*" and a "js" list of files. The script can use the normal DOM, for example document.querySelectorAll("img") to hide images. It runs in an isolated world: it sees the page's HTML but not the page's own JavaScript variables, and the page cannot see yours.
Alternatively, inject code only when the user clicks your button, using chrome.scripting.executeScript with the "activeTab" and "scripting" permissions. This avoids asking for access to every website.
Register a background script with "background": { "service_worker": "background.js" }. It listens for events such as chrome.runtime.onInstalled or messages from the popup sent with chrome.runtime.sendMessage. Because the service worker stops when idle, do not keep data in global variables. Save it with chrome.storage.local, or chrome.storage.sync to sync small settings across the user's devices; this requires the "storage" permission. Most chrome APIs return promises, so you can use await.
When the extension is ready, compress the folder into a ZIP file. Register as a developer in the Chrome Web Store Developer Dashboard, which costs a one-time fee of 5 US dollars, and upload the package. You must add a description, screenshots, a privacy policy if you handle user data, and a justification for each permission. Reviews usually take from a few days to a few weeks. Respect trademarks and copyright, and describe honestly what your extension does: misleading extensions are removed. Start small, publish, and improve from user feedback.
Grade 10 Math: Functions and Reasoning - Quiz
1170 questions