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.
--
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.
--
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.