This Chrome extension allows users to get answers to questions about the current webpage using the Google Gemini API. It provides a quick way to summarize or extract information from any active tab.
- Page Content Analysis: Extracts the text content of the active tab.
 - Gemini API Integration: Sends the extracted content to the Gemini API for processing.
 - Concise Summaries: Generates easy-to-read summaries or answers based on the page content.
 - API Key Management: Allows users to securely store their Gemini API key in the extension's settings.
 - User-Friendly Interface: Simple popup interface for initiating the Q&A process and a dedicated settings page.
 
- User Interaction: When the extension icon is clicked, a popup (
popup.html) appears. - API Key Check: The 
popup.jsscript first checks if a Gemini API key is configured. If not, it prompts the user to enter one in the settings. - Content Extraction: Upon clicking "Ask Gemini", the 
popup.jsinjectscontent.jsinto the active tab. - Page Content Retrieval: 
content.jsextracts theinnerTextof the webpage'sbodyand sends it back topopup.js. - Gemini API Call: 
popup.jsthen makes a request to the Gemini API (gemini-2.5-flashmodel) with the extracted page content, asking for a concise summary. - Display Result: The summary received from the Gemini API is displayed in the popup's textarea.
 - Settings: The 
options.htmlandoption.jsfiles provide a simple interface for users to input and save their Gemini API key using Chrome'schrome.storage.syncAPI. 
manifest.json: The manifest file for the Chrome extension, defining its name, version, permissions, and entry points (popup, options page, background script).popup.html: The HTML structure for the extension's popup window.popup.js: The JavaScript logic for the popup, handling API key checks, content script injection, communication with the content script, and making calls to the Gemini API.options.html: The HTML structure for the extension's settings page, where the Gemini API key is entered.option.js: The JavaScript logic for the options page, handling saving and loading the API key usingchrome.storage.sync.content.js: A content script injected into the active tab to extract the page's text content.background.js: (Currently empty, but defined inmanifest.json) This script would run in the background and could be used for persistent tasks or event listeners.image.png: The icon for the Chrome extension.
- Clone the repository:
git clone https://github.com/abhishekkamble12/webpage_summarization_extension.git cd webpage_summarization_extension - Get a Gemini API Key:
- Go to the Google AI Studio or Google Cloud Console to obtain a Gemini API key.
 
 - Load the Extension in Chrome:
- Open Chrome and navigate to 
chrome://extensions. - Enable "Developer mode" using the toggle in the top right corner.
 - Click "Load unpacked" and select the directory where you cloned this repository.
 
 - Open Chrome and navigate to 
 - Configure API Key:
- Click on the extension icon in your browser toolbar.
 - Click the "⚙️ Settings" button.
 - Enter your Gemini API key in the input field and click "Save API Key".
 
 - Start Using:
- Navigate to any webpage.
 - Click the extension icon and then "Ask Gemini" to get a summary or answer about the page content.
 
 
- The extension uses 
gemini-2.5-flashmodel for generating content. - Error handling is implemented for API key validation and API request failures.
 - The 
maxOutputTokensfor the Gemini API request is set to 2000 to allow for longer summaries.