Skip to content
CAI
Software that uses CAICheck a score

GoogleChrome/chrome-extensions-samples

47.3

Weak · 1 October 2026

39.2k

lines of production code

JavaScript

with C++, Perl, C

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This repository serves as a comprehensive collection of reference implementations and tutorials for developing Chrome Extensions using Manifest V3. It provides concrete code samples demonstrating the usage of core browser APIs, such as tabs, storage, and notifications, alongside advanced patterns like service workers, offscreen documents, and side panels. The system also includes modern functional examples for integrating on-device and cloud-based AI capabilities, while maintaining tooling to index and validate these samples for developer consumption.

How it got here

2012–2023 — Manifest V3 migration and API coverage

70 changes.

The project focused on migrating existing samples from Chrome Apps and Manifest V2 to Manifest V3, while systematically adding new samples for a wide range of Chrome Extension APIs. This period saw the introduction of extensive functional and cookbook examples covering modern features like Offscreen Documents, Side Panels, WebGPU, and WebHID, alongside tooling to automate sample indexing and documentation.

2024–2026 — AI integration and MV3 sample expansion

16 changes.

This period focused on expanding the repository's functional samples to demonstrate advanced Chrome Extension Manifest V3 patterns, including service worker polyfills, offscreen documents, and runtime permission requests. A significant portion of the work involved adding new samples for on-device and cloud-based AI features using Gemini Nano and the Gemini Cloud API, alongside tutorials for inter-extension communication and custom UI behaviors.

Features

Add Bookmarks Manager sample extension

The \functional-samples/sample.bookmarks\ directory now contains a complete Chrome extension sample that demonstrates the \chrome.bookmarks\ API. The extension provides a popup interface where users can search, add, edit, and delete bookmarks. It is built as a Manifest V3 extension using jQuery 1.12.4 and jQuery UI 1.12.1 for the UI components. A specific behavioral detail is that top-level folder titles are now disambiguated with an "(Account)" or "(Local)" suffix based on the \syncing\ property, improving clarity when managing synced versus local bookmarks.

functional-samples/sample.bookmarks · high confidence

Add CO2 meter Chrome extension sample using WebHID

A new functional sample extension has been added to demonstrate using WebHID within an extension service worker. The sample connects to a CO2 meter (specifically the CO2Mini Indoor Air Quality Monitor) to display real-time CO2 and temperature readings in the extension popup and a settings page. It includes a service worker background script to manage device connections and broadcast readings, a device driver module, and UI components for permission granting and status display.

functional-samples/sample.co2meter · high confidence

Add Chrome Alarms API sample for Manifest V3

A new sample extension demonstrating the chrome.alarms API has been added to api-samples/alarms. It is built for Manifest V3, using a service worker (bg-wrapper.js) to initialize a default alarm and open the demo UI. The extension provides a popup interface where users can create alarms with configurable names, delays (in minutes or milliseconds), and repetition periods, view current alarms, cancel individual alarms or all alarms, and see a timestamped log of alarm events.

api-samples/alarms · high confidence

Add Chrome Extension sample for Gemini Cloud API

Added a new functional sample demonstrating how to integrate the Gemini Cloud API into a Chrome Extension. The sample includes a side-panel chat interface that allows users to input prompts and adjust generation temperature, communicating with the Gemini API (specifically using the \gemini-2.5-flash\ model) via the \@google/genai\ client library. The extension uses Manifest V3, loads as an unpacked extension, and requires a user-provided API key for testing.

functional-samples/ai.gemini-in-the-cloud · high confidence

Add Chrome MV3 WebSocket tutorial sample

Added a functional sample demonstrating how to use WebSockets in a Manifest V3 Chrome extension, specifically targeting Chrome M116+ where WebSocket activity extends the service worker lifetime. The sample includes a manifest requiring minimum Chrome version 116, a service worker that toggles a WebSocket connection to a demo server, and a keep-alive mechanism sending pings every 10 seconds to prevent the service worker from becoming inactive.

functional-samples/tutorial.websockets · high confidence

Add Chrome Power API sample extension

A new unpacked extension sample has been added to demonstrate the \chrome.power\ API. The extension, named 'Keep Awake', provides a popup action that cycles through three states: default power-saving, preventing the display from dimming or sleeping, and keeping the system awake while allowing the screen to dim. It uses Manifest V3, persists the selected state in local storage, and updates its icon and title based on the current mode.

api-samples/idle, api-samples/power · high confidence

Add Chrome extension sample for on-device Gemini Nano AI

This location introduces a functional sample extension that demonstrates using Chrome's built-in Gemini Nano model via the Prompt API. The extension provides a chat interface in the side panel, requires Chrome 138+, and is configured to automatically open the side panel when the user clicks the extension icon.

functional-samples/ai.gemini-on-device · high confidence

Add ChromeOS printing sample with roll-printing support

A new extension sample in api-samples/printing demonstrates the chrome.printing API on ChromeOS, including a UI to list printers, submit print jobs, and cancel them. The sample uses Manifest V3 and adds a 'Roll Printers' checkbox that filters for continuous-feed printers and uses a separate test file with variable media height. It also notes that submitJob() throws an error when returning a promise before Chrome 120.

api-samples/printing · high confidence

Add Drink Water Alarm sample extension

A new functional sample extension has been added to demonstrate the Chrome Alarms, Notifications, and Storage APIs. The extension provides a popup interface allowing users to set recurring hydration reminders at 1-minute, 15-minute, or 30-minute intervals. When an alarm fires, a notification is displayed, and users can restart the timer or cancel the alarm directly from the popup.

_functional-samples/sample.water\_alarm\notification · high confidence

Add File Handling API sample for ChromeOS

A new functional sample demonstrates how to use the \file\_handlers\ manifest key and the Launch Handler API to register an extension as a handler for \.txt\ files on ChromeOS. The sample extension opens text files via the Files app and displays the file's name and size on a dedicated page.

_functional-samples/cookbook.file\handlers · high confidence

Add Google API library and Analytics sample for Chrome Packaged Apps

Introduces the \gapi-chrome-apps-lib\ library, which provides a Content Security Policy-compliant loader for the Google API JavaScript client (\gapi\) tailored for Chrome Packaged Apps using the \chrome.identity\ API for authentication. Additionally, adds an Analytics sample application that demonstrates how to integrate Google Analytics tracking into a packaged app using the \chrome-platform-analytics\ library.

_\_archive/apps/libraries, \archive/apps/samples · high confidence

Add MV3 content script injection sample

A new sample extension demonstrates how to inject code into web pages using Manifest V3. The sample includes a popup with two buttons: one injects a JavaScript file (\content-script.js\) and the other injects a function (\showAlert\) with arguments, utilizing the \chrome.scripting.executeScript\ API.

functional-samples/reference.mv3-content-scripts · high confidence

Add Oliver Focus Mode debugging tutorial

Adds a new sample extension, 'Oliver Focus Mode', designed as a debugging exercise for the DevTools Tips video. The sample includes a broken \background.js\ and \focus-mode.js\ for users to fix, alongside a \fixed/\ directory containing the correct implementations. The extension simplifies styling on Chrome Developer documentation pages by hiding non-article content when toggled via the action icon.

functional-samples/tutorial.focus-mode-debugging · high confidence

Add Reading List API sample extension

A new unpacked extension sample has been added to demonstrate the chrome.readingList API. The sample provides a user interface for viewing, adding, updating, and deleting items in the browser's reading list, requiring Chrome version 120 or later and Manifest V3.

api-samples/readingList · high confidence

Add Reading Time tutorial sample for Chrome extensions

Introduces a new functional sample demonstrating how to create a Chrome Extension (Manifest V3) that calculates and displays estimated reading time on documentation pages. The sample includes a content script that counts words in article elements and injects a badge, specifically handling Single Page Application (SPA) navigation by using a MutationObserver to detect dynamically added content.

functional-samples/tutorial.reading-time · high confidence

Add Stylizr storage sample

Added a new Chrome extension sample named Stylizr that demonstrates using the chrome.storage API to persist custom CSS styles. The extension provides an options page for users to input and save CSS snippets, which are then injected into the active tab via the scripting API when the extension's action icon is clicked.

api-samples/storage · high confidence

Add User Scripts API sample

Added a new extension sample in api-samples/userScripts that demonstrates the chrome.userScripts API. The sample provides an options page where users can configure a script to inject into https://example.com/\*, choosing between a bundled file (user-script.js) or custom code entered in a textarea. It requires Chrome 120+ and developer mode, using the service worker to open the options page on install or action click, and manages script registration and updates via chrome.userScripts.register and .update.

api-samples/userScripts · high confidence

Add WASM hello-world sample with console logging

A new functional sample has been added to demonstrate a Rust WebAssembly module that logs messages to the browser console. The sample exposes three entry points: an automatic initialization on load, a simple 'Hello World' print function, and a parameterized print function that accepts a string value.

functional-samples/cookbook.wasm-helloworld-print-nomodule/wasm, functional-samples/cookbook.wasm-helloworld-print/wasm · high confidence

Add WebAssembly cookbook samples for Manifest V3

Adds two new functional samples under \functional-samples/cookbook.wasm-helloworld-print\ that demonstrate how to load and use WebAssembly in Chrome Extensions Manifest V3. The first sample shows loading WASM as an ES module (using \background.type: module\), while the second shows loading it without modules (using \importScripts\). Both samples require the \wasm-unsafe-eval\ Content Security Policy directive and include pre-built WASM artifacts and TypeScript definitions to help developers integrate Rust-compiled WASM into their extensions.

functional-samples/cookbook.wasm-helloworld-print · high confidence

Add WebGPU extension functional sample

A new functional sample extension demonstrates using the WebGPU API within a Manifest V3 service worker to render a red triangle. Users can load this unpacked extension in Chrome to click the action icon, which triggers the service worker to generate the triangle via an OffscreenCanvas and open the resulting image in a new tab. The sample includes a README noting that WebGPU service worker support is enabled by default in Chrome 124, with instructions for enabling it via flags in Chrome 123.

functional-samples/sample.page-redder, functional-samples/sample.webgpu · high confidence

Add chrome.commands API sample

Added a new sample extension in the api-samples/commands directory that demonstrates the chrome.commands API. The sample defines two custom keyboard shortcuts (Ctrl+Shift+Y and Command+Shift+Y for 'run-action', and Ctrl+Shift+U for 'toggle-feature') in its manifest, listens for command events in the background service worker to trigger notifications and toggle a feature state, and displays the registered shortcuts and their bindings in a popup window.

api-samples/commands, api-samples/scripting · high confidence

Add debugger sample extension for capturing network events

A new sample extension has been added to demonstrate the \chrome.debugger\ API. When the user clicks the extension's action button on an HTTP/HTTPS page, the extension attaches to the tab, enables network monitoring, and logs received network response data to the developer console.

api-samples/debugger · high confidence

Add download\_manager sample extension

A new sample extension demonstrating the \chrome.downloads\ API has been added to \api-samples/downloads/download\_manager\. It implements a simple download manager UI in a popup, allowing users to search, pause, resume, cancel, and erase downloads, as well as open the downloads folder. The extension uses a service worker to poll download progress and dynamically update the action icon based on download states (in-progress, paused, dangerous, or recently completed).

(repo-wide) · high confidence

Add mole game tutorial sample

Added a new functional sample demonstrating a multi-extension Chrome MV3 game where a controller extension periodically spawns mole extensions that appear in the browser toolbar. The sample illustrates inter-extension communication using \chrome.runtime.sendMessage\ and \chrome.runtime.onMessageExternal\, discovery via the \chrome.management\ API, and background tasks using \chrome.alarms\. It includes a controller and mole extension structure with service workers, and demonstrates a feature where missing a mole can optionally close a browser tab (disabled by default).

functional-samples/ai.gemini-on-device/sidepanel, functional-samples/tutorial.mole-game · high confidence

Add no-cookies Rule Manager sample extension

A new sample extension, \sample.dnr-rule-manager\, has been added to demonstrate the \chrome.declarativeNetRequest\ API. It installs with two default rules that remove the \Cookie\ header from main frame and XHR requests matching specific URL patterns (e.g., \?no-cookies=1\ or \\*.google.com\). The extension provides a manager UI (\manager.html\) allowing users to dynamically add, edit, and remove these declarative net request rules, and includes a popup (\popup.html\) that displays matched rule history for the current tab.

functional-samples/sample.dnr-rule-manager · high confidence

Add offscreen DOM parsing sample

A new functional sample demonstrates how to use the Offscreen API to parse and modify DOM content from an Extension Service Worker, which lacks direct DOM access. The sample includes a manifest requesting the 'offscreen' permission, a background script that creates the offscreen document using the DOM\_PARSER reason, and an offscreen page that uses DOMParser to transform HTML (adding exclamation marks to headings) and communicates results back to the background via message passing.

functional-samples/cookbook.offscreen-dom · high confidence

Add offscreen user-media recording sample

Added a new cookbook sample that demonstrates recording microphone audio in an offscreen document. The sample includes a background service worker to manage the offscreen document lifecycle, a popup UI for start/stop controls and playback, and a temporary permission page to handle the initial microphone grant required since offscreen documents cannot trigger permission prompts directly.

functional-samples/cookbook.offscreen-user-media · high confidence

Add on-device summarization sample using Chrome's Summarizer API

This location introduces a new Chrome extension sample that demonstrates on-device AI summarization using the Summarizer API and Gemini Nano. The extension adds a side panel that automatically displays AI-generated summaries of web pages. It uses Mozilla's Readability library to extract main content from pages and passes it to the local Summarizer API, allowing users to configure summary type (Key Points, TL;DR, Teaser, Headline), length (Short, Medium, Long), and format (Markdown, Plain text). The sample includes a background service worker to handle tab updates and content extraction, a side panel UI with settings, and build configuration via Rollup.

functional-samples/ai.gemini-on-device-summarization · high confidence

Add rich notifications sample extension

A new sample extension has been added to demonstrate the Chrome Notifications API. It includes a manifest, popup UI, and logic to create and interact with basic, progress, and list notification types.

api-samples/richNotification · high confidence

Add sample Chrome theme demonstrating color customization options

A new sample Chrome extension has been added to the functional-samples directory that demonstrates various theme color customization options. This unpacked extension allows users to see how different UI elements like tabs, frames, bookmarks, and the omnibox can be styled with specific colors, serving as a reference for creating custom Chrome themes.

functional-samples/sample.theme · high confidence

Add sample for silent push notifications in Chrome 132+

A new cookbook sample demonstrates how to use the Push API with \userVisibleOnly: false\ to receive push messages without triggering a browser notification, a capability available in Chrome 132 and later that removes the previous requirement for the \notification\ permission.

functional-samples/cookbook.push · high confidence

Add topSites API samples

Added two new sample extensions in the api-samples/topSites directory to demonstrate the chrome.topSites API. The 'basic' sample shows how to retrieve and display the user's most visited sites in an action popup, while the 'magic8ball' sample replaces the new tab page with a random suggestion from the most visited sites, including favicons.

api-samples/declarativeNetRequest, api-samples/topSites · high confidence

Add webNavigation API sample for Manifest V3

A new sample demonstrating the chrome.webNavigation API has been added to the api-samples/webNavigation/basic directory. This Manifest V3 extension uses a service worker to listen for the onCompleted event and triggers a browser notification whenever a page finishes loading, illustrating how to integrate navigation events with the notifications API.

api-samples/webNavigation · high confidence

Added Blank New Tab sample for Manifest V3

A new sample demonstrating the \chrome\_url\_overrides\ manifest key has been added to the \api-samples/override/blank\_ntp\ directory. This Manifest V3 extension replaces the user's default New Tab page with a custom blank HTML page, providing a reference implementation for this specific override capability.

api-samples/override · high confidence

Added Chrome Extensions tutorial samples

New functional samples for the 'Getting Started' and 'Hello World' Chrome Extensions tutorials have been added. The 'Getting Started' sample demonstrates a Manifest V3 extension using a service worker, storage API, and scripting permissions to change a page's background color, while the 'Hello World' sample provides a basic popup extension structure.

functional-samples/tutorial.getting-started · high confidence

Added Chrome extension sample for overriding default keyboard commands

A new sample extension has been added to demonstrate the chrome.commands API, allowing users to define custom keyboard shortcuts (Ctrl+Shift+Left/Right on Windows/Linux, Command+Shift+Left/Right on Mac) to navigate between browser tabs. The sample includes a manifest version 3 background service worker and documentation on how to load and use the unpacked extension.

_api-samples/default\_command\override · high confidence

Added broken-color sample for debugging tutorial

A new sample extension named 'Broken Background Color' has been added to the functional-samples directory to support the 'Debugging extensions' tutorial. This Manifest V3 extension demonstrates how to debug extension components by intentionally introducing two specific bugs: a typo in the service worker event listener ('oninstalled' instead of 'onInstalled') and a variable name mismatch in the content script ('colors' instead of 'color'). Users can load this unpacked extension to practice identifying and fixing these issues while learning to use the Scripting API and chrome.storage.sync.

functional-samples/tutorial.broken-color · high confidence

Added sample applications for native messaging and IRC proxying

This change introduces new sample code for demonstration purposes. It adds a Chrome Native Messaging example (located in \_archive/mv2/api/nativeMessaging) that allows a web app to connect to and exchange messages with a native host, and an IRC proxy servlet (located in \_archive/mv2/extensions/irc/servlet) that bridges WebSocket connections to raw TCP sockets for IRC communication. Additionally, a Python-based App Engine sample demonstrating the Channel API via a Tic-Tac-Toe game is included.

_\_archive/mv2/api/nativeMessaging, \archive/mv2/extensions/irc/servlet, python · high confidence

Added sandboxed iframe samples for Chrome Extensions Manifest V3

Two new extension samples are introduced to demonstrate the use of sandboxed iframes in Manifest V3 extensions. The 'Sandboxed Frame Sample' shows how to pass data via postMessage to a sandboxed iframe that uses the Handlebars library to render templates, bypassing the default Content Security Policy restriction on eval(). The 'Sandboxed Content Sample' demonstrates a sandboxed iframe that uses eval() to dynamically write HTML to its own document. Both samples utilize the manifest 'sandbox' key to grant the necessary permissions.

api-samples/sandbox · high confidence

Added tutorial sample for testing service worker termination

A new functional sample has been added to demonstrate how to test service worker termination in Chrome extensions using both Puppeteer and Selenium. The sample includes a test extension with intentionally broken and fixed service worker implementations, along with test scripts that verify the extension continues to function correctly after the service worker is terminated via the Chrome DevTools Protocol.

functional-samples/tutorial.terminate-sw · high confidence

New 'Merge Windows' sample for Chrome Extensions MV3

A new API sample named 'Merge Windows' has been added to the Windows samples directory, demonstrating how to use the \chrome.windows\ and \chrome.tabs\ APIs in a Manifest V3 extension. The sample includes a service worker that listens for an action click to iterate through all open tabs and move those from other windows into the currently active window, effectively merging them. The entry includes the necessary \manifest.json\, \background.js\, and \README.md\ files to run this unpacked extension.

api-samples/windows · high confidence

New Action API and Favicon API samples added

Added new MV3 extension samples for the Action API and Favicon API. The Action API sample demonstrates how to toggle the action button's enabled state, change the popup page, and customize badge text, badge text color, badge background color, and the action icon. The Favicon API sample demonstrates how to display a website's favicon within an extension popup using the favicon manifest permission.

api-samples/action · high confidence

New Advanced Font Settings sample for Manifest V3

Adds an 'Advanced' sample extension under api-samples/fontSettings that demonstrates the chrome.fontSettings API in a Manifest V3 context. The sample provides an options page where users can modify font families, sizes, and minimum font sizes for various scripts, with changes applied via an 'Apply Changes' workflow. It includes the necessary UI components (overlays, sliders, widgets) and logic to manage pending changes, serving as a reference for developers porting or building font-setting features in MV3.

api-samples/fontSettings · high confidence

New Alt Texter sample for generating accessible image descriptions

Adds the 'Alt Texter' extension sample, which uses Chrome's on-device Prompt API (Gemini Nano) to generate functional, accessible descriptions for images. Users can right-click an image to trigger the generation, view the result in a popup, optionally translate the description into multiple languages using the Translator API, and copy it to the clipboard. The sample requires Chrome 138+ and utilizes the 'activeTab' permission for security.

functional-samples/ai.gemini-on-device-alt-texter · high confidence

New Audio-Scribe sample for on-device audio transcription

This location introduces the Audio-Scribe sample extension, which demonstrates using Chrome's multimodal Prompt API with Gemini Nano to transcribe audio messages directly in the browser. The extension adds a side panel that monitors pages for audio blobs (via \URL.createObjectURL\ overrides), sends them to the on-device model for speech-to-text transcription, and streams the resulting text to the side panel in real-time. A demo chat application is included to facilitate testing of this workflow.

functional-samples/ai.gemini-on-device-audio-scribe · high confidence

New BrowsingData API sample for clearing history

Added a new Manifest V3 extension sample that demonstrates using the chrome.browsingData API to clear user history. The sample includes a popup UI with a dropdown to select a time range (hour, day, week, four weeks, or forever) and a button to trigger the deletion. The implementation correctly handles form submission by preventing the default behavior to avoid page refresh, and provides visual feedback via an overlay message after the data is cleared.

api-samples/browsingData · high confidence

New Chrome Extensions API samples for tabs

Added four new sample extensions under api-samples/tabs that demonstrate the Chrome Tabs API in Manifest V3. The Tab Inspector sample provides a UI to manage windows and tabs (create, move, update, close). The Keyboard Pin sample shows how to toggle the pinned state of the current tab via a keyboard shortcut. The Tab Screenshot sample captures the visible area of the active tab and displays it in a new tab. The Tab Zoom sample demonstrates getting and setting zoom levels, configuring zoom mode and scope, and listening for zoom changes.

api-samples/tabs · high confidence

New Chrome MV3 bookmarks sample

Added a new sample extension in api-samples/bookmarks that demonstrates the Chrome bookmarks API (Manifest V3). The sample provides a popup UI where users can view their entire bookmark tree, add a bookmark for Google, and remove bookmarks matching that URL using chrome.bookmarks.getTree, create, search, and remove.

api-samples/bookmarks · high confidence

Added a new Manifest V3 sample extension that demonstrates using the chrome.contextMenus API to search different country-specific versions of Google. The extension provides a popup UI with checkboxes to enable or disable specific locales, dynamically updating the context menu items based on user selection via chrome.storage.sync.

_api-samples/contextMenus/global\_context\search · high confidence

New Chrome Privacy API sample for Manifest V3

Added a new extension sample in api-samples/privacy that demonstrates the Manifest V3 implementation of the chrome.privacy API. The sample uses a service worker to manage the autofillCreditCardEnabled setting, setting a default value on installation and allowing users to toggle the setting via the extension's action button, which updates the badge text and color to reflect the current state.

api-samples/privacy · high confidence

New Chrome extension tutorial for managing developer documentation tabs

Added a new functional sample, 'tutorial.tabs-manager', demonstrating the Chrome Extensions Manifest V3 API. This sample extension groups tabs related to Chrome Developer documentation into a single 'DOCS' group using the chrome.tabGroups API. The entry includes the full extension source code (manifest, popup UI, and logic) and a README explaining how to load and use the unpacked extension.

functional-samples/tutorial.tabs-manager · high confidence

Added a new Manifest V3 sample extension called 'Cookie Clearer' that demonstrates the chrome.cookies API. The extension provides a popup UI where users can enter a domain name to view and delete all cookies associated with that domain, utilizing chrome.cookies.getAll() and chrome.cookies.remove().

api-samples/cookies · high confidence

New Custom Cursor extension sample for Chrome Extensions MV3

Added a new functional sample demonstrating how to create a Chrome Extension using Manifest V3 that applies a custom cursor (a dinosaur image) to links and the page body on developer.chrome.com. The sample includes a service worker that listens for page clicks, increments a counter stored in chrome.storage.local, and updates the extension's action badge with the click count, illustrating the use of dynamic web accessible resources and content scripts.

functional-samples/tutorial.custom-cursor · high confidence

New Dictionary side panel sample using sidePanel.open()

Added a new functional sample demonstrating the Side Panel API, where right-clicking a word on a webpage opens a side panel to display its definition. The implementation uses a context menu to trigger \chrome.sidePanel.open()\ and leverages \chrome.storage.session\ to pass the selected word to the side panel, ensuring the definition is displayed whether the panel was already open or newly launched.

functional-samples/sample.sidepanel-dictionary · high confidence

New Download Filename Controller sample extension

Added a new sample extension that demonstrates using the chrome.downloads API to control download filenames and conflict actions. The extension provides an options page where users can define rules based on hostname, URL regex, or default filename patterns, specifying whether to overwrite or prompt on conflicts. These rules are applied asynchronously via a service worker listening to the onDeterminingFilename event, allowing users to customize how downloaded files are named and handled.

_api-samples/downloads/download\_filename\controller, functional-samples/tutorial.google-analytics · high confidence

New Focus Mode tutorial extension for Chrome documentation

Added a new functional sample extension that demonstrates how to use the Chrome Scripting API to inject and remove CSS on demand. This 'Focus Mode' extension hides navigation elements and distractions on Chrome's Extensions and Web Store documentation pages, centering the article content for easier reading. Users can toggle the mode via the extension icon or a keyboard shortcut (Ctrl+B / Command+B), with the state maintained per tab.

functional-samples/tutorial.focus-mode · high confidence

New History Override sample for Manifest V3

Added a new sample extension in the api-samples/history/historyOverride directory that demonstrates how to override the default chrome://history page using Manifest V3. The sample includes a custom UI (history.html, style.css, logic.js) that displays browsing history from the last week, allows searching, and provides options to remove individual or all history entries.

api-samples/history/historyOverride · high confidence

New Side Panel API cookbook samples added

Added four new functional samples demonstrating Chrome Extension Manifest V3 Side Panel patterns: a global side panel that appears on all sites, a site-specific panel restricted to google.com with keyboard shortcut support, and a multiple-panel example that switches between a welcome and main view using sidePanel.getOptions().

functional-samples/cookbook.sidepanel-multiple · high confidence

New Text Replacer sample extension

Added a new functional sample extension that allows users to define up to five find-and-replace text pairs via a popup interface, which are then applied to the current page. The extension supports triggering replacements through the popup's 'Replace' button, a context menu option, or a keyboard shortcut (Alt+R), and requires Chrome 148+ to support asynchronous messaging.

functional-samples/sample.text-replacer · high confidence

New Web Accessible Resources sample for Manifest V3

Added a new sample demonstrating how to use the \web\_accessible\_resources\ manifest key in Manifest V3 to control access to extension assets. The sample includes a service worker, content script, and HTML demo that illustrates exposing specific images to different external websites using static references, dynamic injection via \chrome.runtime.getURL()\, and the \use\_dynamic\_url\ flag for enhanced security.

api-samples/web-accessible-resources · high confidence

New chrome.i18n API sample for localized extension popups

Added a new MV3 extension sample in the api-samples/il8n directory that demonstrates the chrome.i18n API. The sample includes a popup (popup.html/popup.js) that uses chrome.i18n.getMessage() to display localized text, with translation files provided for English and French in the \_locales folder.

api-samples/il8n · high confidence

New cookbook sample for opening side panels via user interactions

Added a functional sample demonstrating how to use the \chrome.sidePanel.open()\ API to open side panels in response to user actions. The sample illustrates three scenarios: opening a global side panel via a context menu, opening a tab-specific side panel from an extension page button, and opening a tab-specific side panel from a content script-injected button. This feature requires Chrome 116 or later.

functional-samples/cookbook.sidepanel-open · high confidence

New geolocation content script sample

Added a new functional sample demonstrating how to access geolocation data within a content script using the standard \navigator.geolocation\ API. The sample extension targets \example.com\ and logs the user's latitude and longitude in degrees-minutes-seconds format to the console, providing a reference implementation for this specific use case.

functional-samples/cookbook.geolocation-contentscript · high confidence

New geolocation samples for Chrome Extensions MV3

Added two new functional samples demonstrating how to access the \navigator.geolocation\ API in Manifest V3 extensions: one using an offscreen document to retrieve location data within a service worker, and another using a popup to display the user's position directly.

functional-samples/cookbook.geolocation-offscreen, functional-samples/cookbook.geolocation-popup · high confidence

New omnibox API samples for Chrome Manifest V3

Added two new Chrome extension samples under api-samples/omnibox to demonstrate the Manifest V3 omnibox API. The 'new-tab-search' sample shows how to use the 'omnibox' manifest key with the keyword 'newTab' to open a Google search in a new tab. The 'simple-example' sample demonstrates the full lifecycle of omnibox events (onInputStarted, onInputChanged, onInputEntered, onInputCancelled, onDeleteSuggestion) and includes a logs page to visualize these interactions using the keyword 'omnix'.

api-samples/devtools, api-samples/omnibox · high confidence

New sample demonstrating Favicon API in content scripts

A new sample extension has been added to functional-samples/sample.favicon-cs that demonstrates how to fetch and display a page's favicon using the Favicon API within a content script. The sample targets Google search pages, injecting a 32px favicon overlay at the top-left corner of the page. It utilizes Manifest V3, requests the 'favicon' permission, and configures web accessible resources with dynamic URLs to serve the generated favicon image.

functional-samples/sample.favicon-cs · high confidence

New sample demonstrating XHR polyfilling in service workers

Added a functional sample that shows how to use libraries relying on XMLHttpRequest within a Manifest V3 extension's background service worker. The sample includes a Rollup build configuration and a custom XHR shim that polyfills the API using the Fetch API, allowing existing XHR-based code to run seamlessly in the service worker environment.

functional-samples/libraries-xhr-in-sw · high confidence

New sample demonstrating clipboard writes via Offscreen Document

Added the \cookbook.offscreen-clipboard-write\ sample, which shows how to write text to the system clipboard using the Offscreen API. Since service workers cannot directly access clipboard APIs, this extension uses an offscreen document to perform the write operation via \document.execCommand('copy')\ when the user clicks the extension's action button. The sample includes the necessary manifest permissions (\offscreen\, \clipboardWrite\) and background service worker logic to create the offscreen document, pass the data, and close it after the operation.

functional-samples/cookbook.offscreen-clipboard-write · high confidence

New sample demonstrating download filename overwrite

Added a new extension sample in api-samples/downloads/downloads\_overwrite that demonstrates using the chrome.downloads.onDeterminingFilename handler to force downloads to overwrite existing files instead of appending conflict suffixes like ' (1)' or ' (2)'.

_api-samples/downloads/downloads\overwrite · high confidence

New sample demonstrating optional permissions in a New Tab extension

Added a new functional sample extension that demonstrates how to request and use optional permissions. The extension overrides the browser's New Tab page to include a to-do list feature and offers users the option to grant the 'topSites' permission. When granted, it displays the user's most visited sites with favicons; if denied, a button allows the user to request access later. The sample uses Manifest V3 and relies on the chrome.storage and chrome.permissions APIs.

_functional-samples/sample.optional\permissions · high confidence

New sample demonstrating the permissions.addHostAccessRequest API

A new functional sample has been added to demonstrate the \permissions.addHostAccessRequest\ API, which allows extensions to request host permissions at runtime for origins listed in \optional\_host\_permissions\. The sample includes a manifest, a service worker background script that triggers the request when visiting a specific checkout page, and a content script that displays a confirmation banner.

functional-samples/cookbook.permissions-addhostaccessrequest · high confidence

New sample for recording tabs via offscreen document

Added a new functional sample (sample.tabcapture-recorder) that demonstrates how to use the chrome.tabCapture API to record the current tab's audio and video in the background. The sample uses a service worker and an offscreen document to handle the recording, starting when the user clicks the extension's action button and stopping after 30 seconds or a second click, saving the result as a WebM download.

functional-samples/sample.tabcapture-recorder · high confidence

New sample list generator tooling

A new \sample-list-generator\ tool has been added to the \.repo\ directory to automatically generate \extension-samples.json\, a manifest of all available Chrome extension samples used by developer.chrome.com. The tool includes a script to prefetch and store Chrome API definitions (\extension-apis.json\) and an API detector that analyzes sample code to identify used APIs, methods, and events. This enables developers to quickly find relevant samples based on the specific Chrome APIs they are using.

.repo · high confidence

New sample-list-generator tool for building extension sample indexes

A new internal tool has been added at .repo/sample-list-generator to automatically scan the repository's sample directories (api-samples and functional-samples) and generate an index file (extension-samples.json). The generator reads each sample's manifest.json to extract metadata such as title, description, and permissions, and uses Babel to statically analyze JavaScript files to detect which Chrome Extension APIs are used. It also supports resolving localized strings from \_locales files. The tool requires a pre-generated extension-apis.json file (created via a separate script that fetches type definitions from a configured storage bucket) to correctly classify API calls as methods, properties, events, or types.

.repo/sample-list-generator · high confidence

New sample: Chrome Extension API Reference navigator

Added a new functional sample extension that lets users quickly navigate to Chrome extension API documentation directly from the address bar. By typing 'api' followed by a space, users can search for and open reference pages for APIs like Tabs, Storage, and Scripting. The extension uses the Omnibox API for input handling, local storage to remember recent searches for personalized suggestions, and the Alarms API to fetch daily development tips displayed via a content script on the documentation site.

functional-samples/tutorial.open-api-reference · high confidence

New tabCapture API sample added

A new sample extension demonstrating the chrome.tabCapture API has been added to the api-samples directory. This Manifest V3 extension captures the contents of the active tab and displays the video stream in a separate receiver window, illustrating how to use tabCapture.getMediaStreamId() and communicate between a service worker and a receiver page via chrome.tabs.sendMessage().

api-samples/tabCapture · high confidence

New tutorial sample for handling service worker events

Added a new sample extension, 'Quick API Reference', that demonstrates handling events with service workers. The extension uses the omnibox to navigate to Chrome API reference pages and includes a 'Tip' button that displays random tips fetched from an external source, managed via alarms and storage. This sample covers event handling for \chrome.runtime\, \chrome.omnibox\, and \chrome.alarms\.

functional-samples/tutorial.quick-api-reference · high confidence

New webRequest.onAuthRequired sample for automatic HTTP authentication

Added a new sample extension in the api-samples/webRequest/http-auth directory that demonstrates the Manifest V3 webRequest.onAuthRequired listener. This sample automatically provides credentials (username and password) for HTTP Basic Auth requests to https://httpbin.org/basic-auth/guest/guest, illustrating how to use the webRequestAuthProvider permission and async blocking to handle authentication challenges programmatically.

api-samples/webRequest · high confidence

Behavioural changes

Enforce code quality checks on commit

A pre-commit hook has been added to the repository that runs lint-staged via npx. This ensures that code formatting and linting rules are automatically applied to staged files before a commit is finalized, helping to maintain consistent code quality across the project.

.husky · high confidence

Repository restructured for Chrome Extensions with new contributor guidelines

The project has shifted focus from Chrome Apps to Chrome Extensions, updating the main README to reflect this change and provide clear navigation for API and functional samples. A new CONTRIBUTING.md file establishes a mandatory workflow requiring contributors to open an issue before submitting a pull request, alongside standard CLA and code review requirements. Additionally, the repository now includes a standardized README template for new samples, a .gitignore file to exclude build artifacts and debug directories, and configuration files for Prettier and ESLint to enforce consistent code formatting and linting across the codebase.

(repo-wide) · high confidence

Updated Content Settings sample for Manifest V3

The Content Settings sample has been updated to Manifest V3, migrating from the deprecated background page model to the modern popup-based architecture. Users can now load the extension as an unpacked app and interact with content settings (such as cookies, images, and location) directly through a browser popup, which utilizes the \chrome.contentSettings\ API to get and set permissions for the active tab.

api-samples/contentSettings · high confidence

Updated history sample to Manifest V3

The showHistory sample has been migrated from Manifest V2 to Manifest V3, replacing the background page with a service worker and updating the manifest version. The extension now uses the chrome.history API to display the user's most visited typed URLs in a popup, with the logic updated to handle the asynchronous nature of the service worker environment.

api-samples/history/showHistory · high confidence

Updated native messaging sample to Manifest V3

The native messaging example in api-samples/nativeMessaging has been updated to use Manifest V3, replacing the previous Manifest V2 implementation. The extension now uses the modern action API for its popup interface and includes updated installation scripts for Windows, macOS, and Linux to handle the new host registration paths and permissions.

api-samples/nativeMessaging · high confidence

Test coverage

Added Puppeteer testing tutorial for Chrome extensions

Added a new sample project and accompanying documentation that demonstrates how to test Chrome extensions using Puppeteer. The included test suite shows how to launch a browser with an extension loaded, interact with the extension's service worker to open a popup, and verify the presence of UI elements within that popup.

functional-samples/tutorial.puppeteer · high confidence

Dependencies

Update sample dependencies and tooling versions

This change updates dependencies across multiple functional samples and the sample-list-generator tool. The sample-list-generator now uses Babel 8 (upgraded from Babel 7) and Mocha 12, while the Puppeteer tutorial samples have been updated to use Puppeteer 25 and Jest 30. The Gemini demo sample now depends on @google/genai 2.24.0, and the AI on-device samples have been updated with newer versions of Rollup (4.63.4), dompurify, and marked. Additionally, the WASM helloworld samples have been updated to use wasm-bindgen 0.2.85.

(dependencies) · high confidence

Housekeeping

Archive of deprecated Chrome Apps samples

The \_archive/apps directory now contains a comprehensive README that catalogs the official samples for the deprecated Chrome Apps platform. This documentation provides a structured index of available samples, organized by feature (such as storage, bluetooth, and webview) and mobile support status, along with direct links to install each sample from the Chrome Web Store for users wishing to explore the legacy platform.

_\archive · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 47 → 47 (-0.1)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 67 → 67 (+0.0)
  • Architecture 100 → 95 (-4.1)
  • Maturity 57 → 57 (+0.8)
  • Readiness 57 → 54 (-2.3)
  • Security 76 → 78 (+2.9)
  • Accessibility 31 → 30 (-0.7)
  • Performance 100 (new)

Resolved (7)

  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • High CVE: [GHSA redacted] (functional-samples/tutorial.terminate-sw/selenium/package-lock.json)
  • High CVE: [GHSA redacted] (functional-samples/ai.gemini-on-device-summarization/package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • Off-boarding risk: anonymized user #1

New (24)

  • (anonymous) (cognitive 20) (api-samples/fontSettings/fontSettings Advanced/js/cr/ui.js)
  • (anonymous) (cognitive 44) (api-samples/fontSettings/fontSettings Advanced/js/cr.js)
  • (anonymous) (cyclomatic 31) (api-samples/fontSettings/fontSettings Advanced/js/cr.js)
  • DownloadItem.render (cyclomatic 39) (api-samples/downloads/download_manager/popup.js)
  • High CVE: [GHSA redacted] (.repo/sample-list-generator/package-lock.json)
  • High CVE: [GHSA redacted] (functional-samples/ai.gemini-on-device-calendar-mate/package-lock.json)
  • High CVE: [GHSA redacted] (functional-samples/tutorial.puppeteer/package-lock.json)
  • Hotspot: api-samples/downloads/download_manager/popup.js (api-samples/downloads/download_manager/popup.js)
  • Low CVE: [GHSA redacted] (.repo/sample-list-generator/package-lock.json)
  • Low cohesion: DownloadItem (LCOM4 5) (api-samples/downloads/download_manager/popup.js)
  • Low vulnerability: [GHSA redacted] (functional-samples/ai.gemini-on-device-summarization/package-lock.json)
  • Medium vulnerability: [GHSA redacted] (.repo/sample-list-generator/package-lock.json)
  • Medium: security finding (details withheld)
  • Off-boarding risk: anonymized user #1
  • Outdated: wasm-bindgen
  • Outdated: web-sys
  • Projects may be oversized for their cohesion
  • constructor (cognitive 16) (api-samples/downloads/download_manager/popup.js)
  • dumpNode (cognitive 19) (functional-samples/sample.bookmarks/popup.js)
  • filterLinks (cognitive 20) (api-samples/downloads/download_links/popup.js)
  • …and 4 more

Changes since last survey

  • 6 commits — 6 feature/other, 0 fixes

By area

  • functional-samples/tutorial.terminate-sw — 3 commits
  • (root) — 1 commit
  • functional-samples/ai.gemini-on-device-summarization — 1 commit
  • functional-samples/sample.page-redder — 1 commit

Notable commits

  • change: Bump brace-expansion (#1801)
  • change: Bump brace-expansion from 5.0.7 to 5.0.12 (#1802)
  • change: Bump js-yaml in /functional-samples/tutorial.terminate-sw/selenium (#1797)
  • change: Bump the npm-minor-and-patch group across 10 directories with 10 updates (#1796)
  • change: Bump the npm-minor-and-patch group across 10 directories with 11 updates (#1798)
  • change: Update page-redder code

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

GoogleChrome/chrome-extensions-samples was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit e01a67d830c5ccb82ac567ff86037c9333d2d648 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.