Chrome Built-in AI - Writer API (self.Writer) Not Found in Extension Content Script Despite Correct Origin Trial & Flags

25 views
Skip to first unread message

Sheriff Mudasir

unread,
Oct 14, 2025, 10:24:33 AM (14 days ago) Oct 14
to Chrome Built-in AI Early Preview Program Discussions

Hello!

My name is Sheriff, and I am developing a Chrome Extension named "CopyCat" for the Google Chrome Built-in AI Challenge. I am running into an issue where the Writer API (self.Writer) is consistently unavailable within my extension's content script environment, despite following all documented setup procedures.

Here is a summary of my environment and the extensive troubleshooting steps I have already taken:

1. Actions Completed Successfully:

  • Chrome Version: I am using the latest Chrome Canary build: 143.0.7470.0 (Official Build) canary (64-bit).

  • Enabled chrome://flags: I have correctly enabled all the required flags:

    • #optimization-guide-on-device-model is set to Enabled BypassPerfRequirement.

    • #prompt-api-for-gemini-nano is Enabled.

    • #writer-api-for-gemini-nano is Enabled.

  • Verified chrome://components: The Optimization Guide On Device Model is present, up-to-date, and I have successfully run "Check for update".

  • Origin Trial Registration: I have successfully registered my extension for the Writer API origin trial.

    • My Extension ID: lahdecnlefjbfeelblofhhacahkifklj

    • My Origin: chrome-extension://lahdecnlefjbfeelblofhhacahkifklj

    • The origin trial token is correctly placed in my manifest.json under the origin_trials key.

  • Extension Functionality: My extension's content script successfully injects its UI, extracts context from the page (Shopify), and loads its modal. The logic works perfectly up to the point of the API call.

2. The Core Problem:

Despite the correct setup, when my AI service script (ai-service.js, injected into the main page world) runs await self.Writer.availability(), the self.Writer object is undefined.

  • Console Error: main-CmmPJd-th.js:2 ✗ No AI API found

  • My Log: AI Service: ✗ Generation Error: Error: AI API not found in this browser context.

This indicates that the Writer API is not being exposed to the JavaScript context of my injected scripts, even with a valid origin trial token and the correct browser flags.

3. My Question:

Could you please advise on what might be causing the Writer API to be unavailable in a Manifest V3 extension's content script context? Are there additional permissions, manifest properties, or architectural considerations specific to extensions that I might be missing? Is this a known issue with the current Canary build?


Thank you for your time and assistance.

SAMWEL ELOVAT

unread,
Oct 14, 2025, 10:27:05 AM (14 days ago) Oct 14
to Sheriff Mudasir, Chrome Built-in AI Early Preview Program Discussions
yes it is me 

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/76586237-6799-4818-9658-c80dd26f55a4n%40chromium.org.

Thomas Steiner

unread,
Oct 14, 2025, 10:32:54 AM (14 days ago) Oct 14
to Sheriff Mudasir, Chrome Built-in AI Early Preview Program Discussions
Hi Sheriff,

To start, does it work when you try the Writer API on a regular webpage without the extension? When you paste `await Writer.availability()`, what does it say?

Thanks,
Tom

--
You received this message because you are subscribed to the Google Groups "Chrome Built-in AI Early Preview Program Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ai-dev-previe...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ai-dev-preview-discuss/76586237-6799-4818-9658-c80dd26f55a4n%40chromium.org.


--
Thomas Steiner, PhD—Developer Relations Engineer (blog.tomayac.comtoot.cafe/@tomayac)

Google Spain, S.L.U.
Torre Picasso, Pl. Pablo Ruiz Picasso, 1, Tetuán, 28020 Madrid, Spain

CIF: B63272603
Inscrita en el Registro Mercantil de Madrid, sección 8, Hoja M­-435397 Tomo 24227 Folio 25

----- BEGIN PGP SIGNATURE -----
Version: GnuPG v2.4.8 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck
0fjumBl3DCharaCTersAttH3b0ttom.xKcd.cOm/1181.
----- END PGP SIGNATURE -----
Reply all
Reply to author
Forward
0 new messages