Skip to content

[bug] YouTube Music ads shown in Discord Rich Presence #2

Description

@ClickSentinel

Description

When a YouTube Music ad plays, the presence shows the ad's title/artist instead of clearing. The isAdPlaying() DOM check added in 6255030 is not reliably catching ads in the browser extension context (as opposed to a desktop app), likely because the ad attribute/elements are not yet present in the DOM at the time UpdateData fires.

Steps to reproduce

  1. Open YouTube Music (free tier / no Premium)
  2. Wait for an instream audio ad to play
  3. Observe Discord Rich Presence — shows ad content instead of clearing

Expected behaviour

Presence clears (no activity shown) for the duration of the ad.

Possible causes

  • ytmusic-player-bar[has-ad] attribute may not be set at ad start; needs verification in a live browser session
  • ytmusic-ad-instream-companion-slot may not be present for audio-only ads
  • UpdateData interval may fire before the ad DOM signals appear

Suggested investigation

Inject a console log in isAdPlaying() to confirm which (if any) selector matches during an ad. May need to add video.src or mediaSession.metadata.artwork heuristics as a fallback (ads often have no artwork or a placeholder src).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions