Welcome What's new in Chrome extensions API reference Samples
Welcome What's new in Chrome extensions API reference Samples

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.

Filter by:

Filter by

Type

Permission

API

Filters

Uses the Action API to change the badge text, icon, hover text, or popup page.

Permissions:

No permissions required.

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.

Permissions:

No permissions required.

APIs:

No APIs used.

Uses the chrome.bookmarks API to search through, add, and delete bookmarks from the user's bookmark tree.

Uses the chrome.browsingData API to clear the user's history without requiring the user to visit the history page.

Replace every image by a cat's image in a website you visit

APIs:

No APIs used.

Uses the chrome.commands API by creating a new keyboard macro for switching tabs in the browser window.

Permissions:

No permissions required.

Shows the Chromium release milestone a given code review was merged into.

Permissions: activeTab

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.

Permissions:

No permissions required.

Uses devtools.inspectedWindow to collect and use data on the resouces used in a web page.

Permissions:

No permissions required.

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.

Permissions: favicon

Demonstrates fetching the favicon from www.google.com and inserting it at the top left of every page.

Permissions: favicon

Shows how to use the file_handlers manifest key with the web platform's Launch Handler API.

Permissions:

No permissions required.

APIs:

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.

Permissions:

No permissions required.

APIs:

No APIs used.

Shows how to get geolocation access within a service worker.

Shows how to get geolocation access within a popup.

Permissions: geolocation
APIs:

No APIs used.

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.

Permissions: sidePanel
APIs:

No APIs used.

How to use Google Analytics 4 in your extension.

Base Level Extension

Permissions:

No permissions required.

APIs:

No APIs used.

Demonstrates how to override the default history page.

Demonstrates the Idle API

Demonstrates the chrome.i18n API by localizing text in the extension popup.

Permissions: activeTab

Uses the chrome.tabs API to toggle the pinned state of the current tab.

Permissions:

No permissions required.

Uses the chrome.windows and chrome.tabs APIs to manage tabs across different windows.

Permissions:

No permissions required.

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.

Permissions:

No permissions required.

Demonstrates the "omnibox" manifest key and API by creating a keyword that opens a browser search in a new tab.

Permissions:

No permissions required.

Demonstrates the "omnibox" manifest key and most members of the omnibox API.

Permissions:

No permissions required.

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.

Add the reading time to Chrome Extension documentation articles

Permissions:

No permissions required.

APIs:

No APIs used.

Demonstrates creating a tab for a sandboxed iframe. The sandbox calls eval() to write HTML to its own document.

Permissions:

No permissions required.

Demonstrates creation of a tab with a sandboxed iframe to which the main page passes a counter variable.

Permissions:

No permissions required.

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.

Permissions:

No permissions required.

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.userScripts API to inject JavaScript into web pages.

Shows how to use WebAssembly (WASM) as a module in Manifest V3.

Permissions:

No permissions required.

Shows how to use WebAssembly (WASM) in Manifest V3.

Permissions:

No permissions required.

Uses the web_accessible_resources key in the manifest.json file to control access to assets within an extension.

Permissions:

No permissions required.

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.

How to use WebSockets in your Chrome Extension.

Permissions:

No permissions required.

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.