A tiny Chrome extension that stops YouTube Music and YouTube from pausing your music with the "Are you still there?" / "Video paused. Continue watching?" prompt.
No tracking, no network requests, no remote code. One permission (storage) to remember your on/off setting.
The extension uses two layers:
- Prevention (
src/keepalive.js): YouTube decides you're idle by checkingwindow._lact, the timestamp of your last mouse or keyboard input. This script runs in the page context and refreshes that timestamp once a minute, so the idle prompt shouldn't be triggered at all. - Fallback (
src/content.js): if a prompt shows up anyway, the script clicks Yes and resumes playback.- YouTube Music: detects
ytmusic-you-there-renderer. - YouTube: detects the confirm dialog in
ytd-popup-container, but only when the video is paused and you haven't clicked or typed in the last 30 seconds. That way it never confirms dialogs you opened yourself, such as "Remove from playlist?".
- YouTube Music: detects
The toolbar popup has an on/off switch and a count of how many prompts have been dismissed.
- Download this repository (Code → Download ZIP, then unzip it, or
git cloneit). - Open
chrome://extensionsin Chrome (also works in Edge, Brave, Opera, and other Chromium browsers). - Turn on Developer mode (top-right).
- Click Load unpacked and select the project folder (the one containing
manifest.json). - Reload any YouTube / YouTube Music tabs that were already open.
manifest.json Extension manifest (Manifest V3)
src/keepalive.js Page-context script that keeps the activity timestamp fresh
src/content.js Detects and dismisses the idle prompt, resumes playback
popup/ Toolbar popup (toggle + counter)
icons/ Extension icons
- The prompt still appears. YouTube changes its markup from time to time. Please open an issue and include the site (YouTube or YouTube Music) and, if you can, the prompt's HTML. To get it, right-click the dialog, choose Inspect, then right-click the highlighted element and choose Copy → Copy outerHTML.
- Nothing happens after installing. Reload the YouTube tab. Content scripts are only injected into pages loaded after the extension was installed.
Issues and pull requests are welcome. There is no build step: edit the files, then click the reload icon
on the extension card in chrome://extensions.
This project is not affiliated with, endorsed by, or sponsored by YouTube or Google.