articleSummary is a client-sideJavaScriptuserscript designed to generate concise summaries of Wikipedia articles using Google's Gemini large language model. The script integrates directly into Wikipedia article pages and allows users to generate an AI-produced summary on demand, without modifying Wikipedia content or requiring server-side infrastructure.
The script operates entirely in the user's browser and communicates directly with the Google Gemini API. All configuration data, including the API key, is stored locally.
Features
On-demand AI-generated summaries of Wikipedia articles
Uses official Wikipedia API to retrieve article text
Automatic chunking of long articles to comply with API limits
Progressive summarization and final summary merging
Modern user interface with rounded styling and animated loading indicator
No external libraries or frameworks required
Fully client-side execution
Setup
Prerequisites
Before using articleSummary.js, the following are required:
A registered Wikipedia account
JavaScript enabled in the browser
A Google Gemini API key
The script runs entirely in the user's browser and does not require any browser extensions or userscript managers.
Obtaining a Google Gemini API Key
The script uses Google's Gemini API to generate article summaries. Each user must supply their own API key.
Reload Wikipedia pages (bypass cache if necessary).
The script will now load automatically on Wikipedia pages while you are logged in.
First-Time Use
When the Generate AI Summary button is clicked for the first time:
The script will prompt the user to enter their Gemini API key.
The key is stored locally using localStorage in the browser.
The key is never sent to Wikipedia or shared with other users.
If the stored key is removed from localStorage, the prompt will appear again.
API Key Storage and Privacy
The API key is stored only in the user's browser.
The key is used solely to send requests directly to Google's Gemini API.
Wikipedia servers do not receive or store the API key.
All generated summaries remain local and are not saved or published.
Users are responsible for complying with Google's API usage limits and terms of service.
License and Disclaimer
This script is provided for personal and educational use. Generated summaries are not official Wikipedia content and should not be treated as authoritative sources.