* Migrate to latest version of the language model * Update readme to better describe the sample. * More readme updates * Consistent API naming and format lists
On-device Summarization with Gemini Nano
This sample demonstrates how to use Chrome's built-in Summarizer API to generate AI-powered summaries of web pages directly on the user's device. The summarization runs entirely locally using Gemini Nano, ensuring privacy and fast performance without requiring an internet connection or API keys.
To learn more about the Summarizer API, head over to the Summarizer API guide on developer.chrome.com.
Overview
This extension adds a side panel that automatically displays AI-generated summaries of any web page you visit. It uses Mozilla's Readability library to extract the main content from web pages (stripping away navigation, ads, and other clutter), then passes that content to Chrome's built-in Summarizer API.
Running this extension
- Clone this repository.
- Run
npm installin this folder to install all dependencies. - Run
npm run buildto build the extension. - Load the newly created
distdirectory in Chrome as an unpacked extension. - Click the extension icon to open the summary side panel.
- Open any web page. The page's content summary will automatically be displayed in the side panel.
Creating your own extension
If you use this sample as the foundation for your own extension, be sure to update the "trial_tokens" field with your own origin trial token and to remove the "key" field in manifest.json.