Azkhan Abdul Salam • 7 months ago
Need help with Gemini Nano API not injecting in Chrome Canary
Hello,
I’m working on the on-device Gemini Nano APIs in a Chrome extension, but they don’t seem to be injected.
Even though the model shows as Ready (GPU) in chrome://on-device-internals (Chrome Canary v144 on macOS) and all the required flags are enabled, both window.ai and chrome.ai remain undefined.
Console shows:
Uncaught TypeError: Cannot read properties of undefined (reading 'languageModel')
I’ve tried restarting Chrome, reloading the extension, and waiting for the model to initialize, no luck so far.
Is this a known limitation in Canary 144, or do extensions need additional access to use window.ai / chrome.ai?
Any insights or confirmations from the Chrome team or other developers would be greatly appreciated!
Thanks,
Azkhan
Comments are closed.

3 comments
François Beaufort Manager • 7 months ago
Do not use window.ai or chrome.ai. Use LanguageModel. See https://developer.chrome.com/docs/ai/prompt-api#use_the_prompt_api
Azkhan Abdul Salam • 7 months ago
Thank you, it has been really helpful during this crucial time. I appreciate that!
Lukman Abdulsalam • 7 months ago
This is really helpful.
is there also a need to add the specific api in the extension permission @francois,
for example, if i am using the prompt_api, should it be included in the permissions?