the autopilot extension was closing the wrong tabs. i was watching a stremio video, it ended, and the tab closed, and the same thing happened on a couple of x tabs with videos. the cause was a missing ownership check. the content script injects on every cast host, not just youtube, so the video ended listener fired anywhere, and the advance logic looked for the next youtube tab, activated it, and removed the ended tab without ever asking whether the ended tab was a youtube tab in the first place.
the fix added two guards. the content script now does nothing on a non youtube host, and the background logic refuses to run unless the ended tab itself passes the youtube url test. so the rule is two conditions instead of one: the ended tab is a youtube video page, and another youtube video tab exists in that window. stremio, x, reddit, pinterest, and instagram tabs stop being collateral damage, and real youtube runs still advance as before.
separately the cast path needed a wake for the screensaver. a cast arriving while the black dream layer held the screen kept failing to play, because the intent went in under the dream. now the cast checks the dream state, sends a wake, presses back to clear it, then sends the intent, and retries once when playback still fails. the verification runs in the log line so the next failure names its own state instead of a generic not playing.