Page Summarizer

Chrome API Compatible Version

🔵 Uses window.ai.languageModel
🔖

Get the Bookmarklet

Summarize (Chrome API)

Drag this button to your bookmarks bar

Requires Web Agent API
🔵 Chrome API compatible
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...
💻

The Code

This version uses the Chrome Prompt API style. The entire logic is just 4 lines:

// Create session using Chrome's languageModel API
const session = await window.ai.languageModel.create({
  systemPrompt: 'Summarize clearly in 2-3 paragraphs.'
});

// Prompt with page content
const summary = await session.prompt(document.body.innerText);

// That's it! Permissions are auto-requested.

No explicit permission request needed! Web Agent API implementations automatically show the permission dialog when languageModel.create() is called.

🔄

API Comparison

The Web Agent API supports both Chrome's API and its own extended API:

Check availability
await ai.languageModel.capabilities()
Create session
await ai.languageModel.create(options)
Prompt
await session.prompt(text)
Stream
session.promptStreaming(text)
Clone session
await session.clone()
Destroy
await session.destroy()
🔮 See the Web Agent API style version →

Why Chrome Compatibility?