<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8" -->

---
title: How to Use Transformers.js in a Chrome Extension | daily.dev
description: A practical guide to integrating Transformers.js into a Chrome extension under Manifest V3 constraints. Covers the three-runtime architecture (background...
canonical: https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Use Transformers.js in a Chrome Extension | daily.dev
og:description: A practical guide to integrating Transformers.js into a Chrome extension under Manifest V3 constraints. Covers the three-runtime architecture (background...
og:url: https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8
og:image: https://api.daily.dev/og/posts/CLJXqw6U8.png
og:image:alt: How to Use Transformers.js in a Chrome Extension
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Use Transformers.js in a Chrome Extension

**[Hugging Face](https://daily.dev/sources/huggingface)** · 9 min read · 1 upvotes · 0 comments

## Summary

A practical guide to integrating Transformers.js into a Chrome extension under Manifest V3 constraints. Covers the three-runtime architecture (background service worker, side panel, content script), how to host AI models (Gemma 4 E2B for text generation, MiniLM for embeddings) in the background worker to avoid duplicate loads, the typed messaging contract between runtimes, an agentic tool-calling loop with tool normalization and output parsing, state persistence strategies (memory, chrome.storage, IndexedDB), and Vite build configuration for multi-entry MV3 outputs.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://huggingface.co/blog/transformersjs-chrome-extension>

## Similar posts on daily.dev

- [Multimodal Browser AI with Transformers.js for Images and Speech](https://daily.dev/posts/multimodal-browser-ai-with-transformers-js-for-images-and-speech-n61aoocbh) · Machine Learning Mastery · 1 upvotes · 0 comments
- [Building Semantic Search with Transformers.js and Sentence Embeddings](https://daily.dev/posts/building-semantic-search-with-transformers-js-and-sentence-embeddings-ohtnpfpyj) · Machine Learning Mastery · 1 upvotes · 0 comments

---

Tags: [#devtools](https://daily.dev/tags/devtools), [#ai-agents](https://daily.dev/tags/ai-agents), [#webgpu](https://daily.dev/tags/webgpu)

[View this post on daily.dev](https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Use Transformers.js in a Chrome Extension","url":"https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8"},"datePublished":"2026-04-24T07:17:05.161Z","dateModified":"2026-04-24T07:17:31.550Z","description":"A practical guide to integrating Transformers.js into a Chrome extension under Manifest V3 constraints. Covers the three-runtime architecture (background...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e2d1d9b5dcd7500e616b9a24a79fe61b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e2d1d9b5dcd7500e616b9a24a79fe61b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hugging Face","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hugging Face","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/f1f55c67d81a4330acf5b90b26b0c8e1","url":"https://daily.dev/sources/huggingface"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-use-transformers-js-in-a-chrome-extension-cljxqw6u8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devtools,ai-agents,webgpu","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hugging Face","item":"https://daily.dev/sources/huggingface"},{"@type":"ListItem","position":3,"name":"How to Use Transformers.js in a Chrome Extension"}]}
```

