Page Summarizer

A bookmarklet that summarizes any webpage using the Web Agent API

🔖

Get the Bookmarklet

📝 Summarize Page

Drag this button to your bookmarks bar

1

Drag to Bookmarks Bar

Drag the "Summarize Page" button above to your browser's bookmarks toolbar

2

Visit Any Page

Navigate to an article, documentation, or any page you want summarized

3

Click the Bookmarklet

Click "Summarize Page" in your bookmarks — a summary overlay will appear

Requires Web Agent API
🤖 Requires LLM configured
Preview: What you'll see
📄 Page Summary
This article discusses the key features of the new API, including improved performance, better error handling, and simplified authentication. The main takeaways are...
💻

How It Works

The Web Agent API supports two coding styles. The Chrome-compatible way auto-handles permissions:

// Chrome-compatible style (auto-permissions)
const session = await window.ai.createTextSession();
const summary = await session.prompt(document.body.innerText);

// Or using the Chrome Prompt API style:
const session = await window.ai.languageModel.create({
  systemPrompt: 'Summarize clearly and concisely.'
});
const summary = await session.prompt(text);

Or the explicit Web Agent API style with fine-grained control:

// Explicit Web Agent API style (full control)
await window.agent.requestPermissions({
  scopes: ['model:prompt', 'browser:activeTab.read'],
  reason: 'Summarize the current page'
});

// Read page content via extension API
const tab = await window.agent.browser.activeTab.readability();

// Create AI session with custom options
const session = await window.ai.createTextSession({
  systemPrompt: 'Summarize clearly and concisely.',
  temperature: 0.7
});

const summary = await session.prompt(tab.text);

Tip: The Chrome-compatible style is simpler — permissions are auto-requested when needed. Use the explicit style when you need more control over permissions, want to specify a custom reason, or need access to browser APIs like activeTab.read.

🔵 See the Chrome API version →
🛠️

Build Your Own

This pattern works for any AI-powered browser tool. Fork this example to build: