YouTube – Standard DOM Capture
Implementation: sources/youtube.js
- Needs the live chat tab open in a signed-in browser session. Membership and gift cards only render for the channel owner or authorized moderators.
- Capture Stream Events must stay enabled for membership, gift, and milestone notices. Super Chats/Super Stickers arrive regardless.
- Viewer counts require Show viewer count or Hype Mode to be enabled in settings.
| Event | When it Fires | Payload Notes |
|---|---|---|
sponsorship |
Membership welcome header without explicit chat text (new members, gifted bundles landing). | membership populated with translated “MEMBERSHIP”; subtitle contains streak/tier when detected. |
giftpurchase |
Gift bundle purchase banner (ytd-sponsorships-live-chat-gift-purchase). |
hasDonation set to “N Gifted”; donoValue approximates USD (5 × quantity); membership becomes “SPONSORSHIP”. |
giftredemption |
Gift redemption announcement for recipients. | membership becomes “MEMBERSHIP”; subtitle includes “Gifted by …”. |
new-membership |
Structured welcome cards or localized “Welcome to …” text. | membership “MEMBERSHIP”; subtitle carries tier/title; nameColor uses membership green when allowed. |
upgraded-membership |
Upgrade banners that include “upgraded to …”. | subtitle captures new tier label; membership remains “MEMBERSHIP”. |
jeweldonation |
Gift-card style promos (eg. YouTube “Jewels”). | Parses jewel count into hasDonation (“500 Jewels”) and numeric donoValue for USD estimation. |
donation |
Super Chats, Super Stickers, donation announcement cards. | hasDonation carries site-formatted amount; when no message is present the text fallback triggers thankyou. |
thankyou |
Fallback message when a donation amount exists but no chat text was supplied. | Keeps hasDonation and auto-injects “Thank you for your donation!” for overlays. |
viewer_update |
30s poll of Social Stream’s viewer endpoint (fallback to page scrape on quota errors). | meta is the live viewer integer; contributes to aggregated viewer_updates in the background script. |
Membership blocks also set membership for moderator/member chat, while subtitle carries either month counts or tier names. sourceName/sourceImg populate once getChannelInfo succeeds.