Extension to highlight messages in Twitch and YouTube live chats that may require moderator attention, using Google Chrome's on-board Gemini Nano model without any network requests.
This extension executes on the following pages:
https://www.twitch.tv/moderator/*https://www.youtube.com/live_chat*https://www.youtube.com/live_chat_replay*
manifest.json: Chrome Extension Manifest V3 configurationsrc/background/service-worker.js: routes AI requests to the offscreen documentsrc/offscreen/offscreen.html: extension offscreen document used for Prompt API accesssrc/offscreen/offscreen.js: receives AI invocation requests and executes themsrc/content/shared/ai-client.js: content-script proxy for AI calls through background messagingsrc/content/shared/moderation-prompts.txt: raw moderation system prompt textsrc/content/shared/chat-moderation.js: shared chat moderation pipeline used by site scriptssrc/content/shared/gemini-nano.js: shared Gemini Nano helper loaded by the offscreen documentsrc/content/twitch-moderator.js: content script for Twitch moderator pagessrc/content/youtube-live-chat.js: content script for YouTube live chat pages
- Go here and ensure you are able to execute prompts in your browser by using the demo
- unfortunately this extension only works on Chrome at the moment. ensure that you have the proper Chrome flags enabled
- navigate to
chrome://flags/#prompt-api-for-gemini-nanoand set toEnabled - navigate to
chrome://flags/#optimization-guide-on-device-modeland set toEnabled
- navigate to
- unfortunately this extension only works on Chrome at the moment. ensure that you have the proper Chrome flags enabled
- Clone or download this repository to your local machine. a. click the green "Code" button above and select "Download ZIP", then extract the ZIP file to a folder on your computer.
- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select this folder
- Open a matching Twitch moderator or YouTube live chat page
- Open DevTools on that page
- Look for the console messages from the content scripts
- Click the extension icon to open the settings popup and configure: a. streamer nickname b. medium severity color c. high severity color