Chrome Extension Samples
The list contains all the samples from the Extensions sample repository. Use these to learn how extensions work or as a starting point for building your own extensions.
Uses the Action API to change the badge text, icon, hover text, or popup page.
Demonstrates the chrome.fontSettings API by allowing users to modify the style of displayed fonts on web pages.
Uses the chrome.alarms API to allow the user to set alarms using an extension page.
Uses the "chrome_url_overrides" manifest key by replacing the user's default new tab page with a new html file.
No APIs used.
Uses the chrome.bookmarks API to search through, add, and delete bookmarks from the user's bookmark tree.
Fix an Extension!
Uses the chrome.browsingData API to clear the user's history without requiring the user to visit the history page.
Uses the chrome.commands API by creating a new keyboard macro for switching tabs in the browser window.
Shows the Chromium release milestone a given code review was merged into.
Uses chrome.contentSettings to display the settings of a given page in the extension's popup.
Uses the chrome.contextMenus API to customize the context menu.
Uses the chrome.cookies API by letting a user delete their cookies via a popup.
Uses the chrome.debugger API to capture network events on web pages.
Uses the devtools API to add a sidebar that displays the jQuery data associated with the selected DOM element.
Uses devtools.inspectedWindow to collect and use data on the resouces used in a web page.
Provides definitions in the side panel.
Demonstrates usage and features of the event page by reminding user to drink water
Demonstrates the favicon manifest permission by displaying the favicon of a url in the extension popup.
Demonstrates fetching the favicon from www.google.com and inserting it at the top left of every page.
Shows how to use the file_handlers manifest key with the web platform's Launch Handler API.
No APIs used.
Enable focus mode on Chrome's official Extensions and Chrome Web Store documentation.
Demonstrates the chrome.fontSettings API by allowing users to modify the size of fonts on webpages.
Shows how to get geolocation access within a content script.
No APIs used.
Shows how to get geolocation access within a service worker.
Build an Extension!
Uses the context menu to search a different country's Google
Shows how to display the same side panel on every site using the Side Panel API.
No APIs used.
How to use Google Analytics 4 in your extension.
Demonstrates how to override the default history page.
Demonstrates the Idle API
Demonstrates the chrome.i18n API by localizing text in the extension popup.
Uses the chrome.tabs API to toggle the pinned state of the current tab.
Uses the chrome.windows and chrome.tabs APIs to manage tabs across different windows.
This recipe shows how to use sidePanel.getOptions() to retrieve the current side panel and switch between side panels.
A browser action with a popup dump of all bookmarks, including search, add, edit and delete.
Uses the chrome.declarativeNetRequest API to remove the "Cookie" header from requests.
Demonstrates the chrome.declarativeNetRequest API by providing a UI to manipulate declarativeNetRequest rules dynamically.
Demonstrates the creation of, and interaction with, each of the notification template types.
Shows how to write a string to the system clipboard using the offscreen document.
Shows how to use DOMParser in an extension service worker using the offscreen document.
Example extension from DevTools Tips video.
Demonstrates the "omnibox" manifest key and API by creating a keyword that opens a browser search in a new tab.
Demonstrates the "omnibox" manifest key and most members of the omnibox API.
Shows how to call sidePanel.open() to open a global side panel.
Demonstrates optional permissions in extensions
Turns the page red when you click the icon
Demonstrates all four methods of the chrome.printing namespace.
Uses the chrome.privacy.services property to get and set privacy settings.
Quick API can speed up the building of Chrome extensions.
Uses the chrome.readingList API to display, update and remove reading list entries.
Demonstrates creating a tab for a sandboxed iframe. The sandbox calls eval() to write HTML to its own document.
Demonstrates creation of a tab with a sandboxed iframe to which the main page passes a counter variable.
Uses the chrome.scripting API to inject JavaScript into web pages.
Shows how to display the side panel only on google.com using the Side Panel API.
Demonstrates how to use the chrome.storage API.
Records the current tab in an offscreen document.
Demonstrates how to use the chrome.tabCapture API.
Demonstrates the chrome.tabs API and the chrome.windows API by providing a user interface to manage tabs and windows.
Uses the tabs.zoom API to manipulate the zoom level of the current tab.
Uses the chrome.tabs API to take a screenshot of the active tab.
Uses the chrome.topSites API to get the user's most visited sites.
Uses the chrome.topSites API to suggest which sites a user should visit.
Uses the chrome.history API to display in a popup the user's most visited pages.
Uses the chrome.declarativeNetRequest API to block requests.
Uses the chrome.declarativeNetRequest API to redirect requests.
Uses the chrome.userScripts API to inject JavaScript into web pages.
Shows how to use WebAssembly (WASM) as a module in Manifest V3.
Shows how to use WebAssembly (WASM) in Manifest V3.
Uses the web_accessible_resources key in the manifest.json file to control access to assets within an extension.
Uses the webNavigation API to send notifications.
Demonstrates the webRequest.onAuthRequired listener to detect an authentication request and log the user into the designated site.