Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Moderation Highlight Extension

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*

Files

  • manifest.json: Chrome Extension Manifest V3 configuration
  • src/background/service-worker.js: routes AI requests to the offscreen document
  • src/offscreen/offscreen.html: extension offscreen document used for Prompt API access
  • src/offscreen/offscreen.js: receives AI invocation requests and executes them
  • src/content/shared/ai-client.js: content-script proxy for AI calls through background messaging
  • src/content/shared/moderation-prompts.txt: raw moderation system prompt text
  • src/content/shared/chat-moderation.js: shared chat moderation pipeline used by site scripts
  • src/content/shared/gemini-nano.js: shared Gemini Nano helper loaded by the offscreen document
  • src/content/twitch-moderator.js: content script for Twitch moderator pages
  • src/content/youtube-live-chat.js: content script for YouTube live chat pages

Load in Chrome

  1. 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-nano and set to Enabled
      • navigate to chrome://flags/#optimization-guide-on-device-model and set to Enabled
  2. 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.
  3. Open chrome://extensions
  4. Enable Developer mode
  5. Click Load unpacked
  6. Select this folder

Verify

  1. Open a matching Twitch moderator or YouTube live chat page
  2. Open DevTools on that page
  3. Look for the console messages from the content scripts
  4. Click the extension icon to open the settings popup and configure: a. streamer nickname b. medium severity color c. high severity color

About

Lightweight Google Chrome extension to highlight messages on Twitch and Youtube that may violate channel rules using Gemini Nano

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages