GEMINI LABJP
NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20
Articles/Dev Tools
Dev Tools/2026-03-30Advanced

Gemini API × Chrome Extension — Build a Browser-Native AI Assistant with Streaming and Conversation History

Learn how to build a Chrome Extension powered by Gemini API. Create a Manifest V3 side panel AI assistant with page summarization, translation, and code analysis features.

gemini-api277chrome-extensionjavascript3manifest-v3browser-ai

Premium Article

Making my browser time a little smarter

As an indie developer, I spend far more hours in the browser than I would like to admit. Reading articles, tracing code, hopping between docs in another language — and in those gaps the same wish keeps surfacing: "just summarize this part," or "tell me in one line what this code is doing."

Pasting into a separate AI chat tab every single time quietly breaks my focus. So I decided to let an AI live inside the browser itself, and built a side-panel assistant with the Gemini API and a Chrome Extension. What follows is that design and implementation — including the spots where I got stuck — shown as the working code I actually use day to day at Dolice.

This guide is for developers comfortable with basic JavaScript who want to try Chrome Extension development, or experienced extension authors looking to add AI features to an existing project.

Chrome Extension Architecture

A Chrome Extension built with Gemini API consists of three distinct layers, each with a specific responsibility.

Service Worker (Background Script): In Manifest V3, Service Workers replace the legacy Background Pages. All Gemini API HTTP requests are handled here, keeping your API key secure and isolated from page-level scripts.

Content Script: This script runs in the context of web pages, accessing the DOM to extract text content, detect code blocks, and highlight elements. It acts as a bridge between the page and the background.

Side Panel UI: Available since Chrome 114, the Side Panel provides a dedicated space for the chat interface and result display. All user interaction happens here, separate from the web page content.

This separation of concerns ensures API key security, clean DOM access, and a polished user experience — each handled by the right layer.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Building summarize, translate, and code-analysis into a single Manifest V3 side-panel UI
Streaming responses token-by-token with streamGenerateContent and a chrome.runtime port
Keeping conversation history in chrome.storage.session, trimmed to the last 20 turns
Lessons from real use: Service Worker idling, ~40% input-token savings, and 429 backoff
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-07-11
Never Generate the Same Narration Twice: Cache-Key Design and Invalidation for Gemini TTS Output
For apps that replay the same audio over and over—meditation, language learning, storytelling—caching the Gemini TTS output itself drives the variable cost to near zero. This is a working design: how to build a cache key that text alone can't cover, a two-tier server-plus-device cache, and an invalidation policy that survives model shutdowns like the August 17 image-model deprecation.
Dev Tools2026-06-30
Building an AI-Powered Content Site with Gemini API and Astro
Combine Astro Server Endpoints and Content Collections with the Gemini API to add AI summaries, related-article recommendations, and auto-tagging.
Dev Tools2026-06-28
Gemini API × PWA Complete Implementation Guide — Service Workers, Offline AI, and Web Push Notifications for App Store-Quality Web Apps
Build production-grade AI web apps by combining Gemini API with Progressive Web App techniques — Service Worker caching, IndexedDB for AI context persistence, offline fallbacks, and Web Push notifications — plus instrumentation to surface API cost from your cache hit rate.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →