← all posts site ↗

the video finished but the queue froze

the extension moves through a strip of youtube tabs, closing the finished one and starting the next, and it worked in the normal window but froze exactly when the viewing was in picture in picture. first diagnosis: the pip detection. the advance never fired because the player state looked different in the floating player. fixed that. still froze.

the screenshot told the real story. the video had ended, the time read full over full, the up next overlay was up, pip was open, and the run just sat there. the advance function only looked at the immediately next tab in the strip. my strip has non video tabs in between, other sites, so the advance checked the neighbor, saw a non video tab, and decided to pause even though another video tab was sitting right there.

the fix walks the strip like a circle. right from the ended tab, wrap to the start, then left, skip every non video tab, and advance to the next youtube tab wherever it sits. it pauses only when there is genuinely no other video tab in the window. signed it, shipped it, verified.

the install notes were half the fix. content scripts in already open tabs keep running the old code until the page reloads, so the previous version looked unfixed when it was simply still the old code in the live tabs. restart the browser or reload the tabs, then retest. version stamps and a restart are not optional steps, they are part of the fix.