🎡 YTM Keep-Alive

February 22, 2026 Β· View on GitHub

πŸ‡¬πŸ‡§ English | πŸ‡ΉπŸ‡· TΓΌrkΓ§e

🎡 YTM Keep-Alive

screenshot (3)
screenshot (1) screenshot (2)

A lightweight, pure DOM bookmarklet to prevent YouTube and YouTube Music from pausing with the "Video paused. Continue watching?" prompt.

✨ Features

  • No Extensions Required: Keeps your browser fast and clean.
  • 100% Safe (TrustedHTML Bypass): Built entirely with pure DOM elements (document.createElement). It does not use innerHTML, completely bypassing YouTube's strict Content Security Policy (CSP).
  • Draggable UI: Features a sleek, dark-themed floating timer that you can drag anywhere on the screen.
  • Smart Detection: Clicks the "Yes" confirmation button automatically within seconds of it appearing.

πŸš€ Easy Installation

You don't need to copy or paste any code.

  1. Go to the Installation Page
  2. Drag and drop the red "Drag to Bookmarks" button to your browser's bookmarks bar.
  3. Open YouTube Music, click the bookmark, and enjoy uninterrupted music!

πŸ› οΈ How it Works

Once activated, it creates a sleek floating widget. It now scans the DOM every single second for the confirmation prompt, ensuring lightning-fast detection. To prevent the browser from suspending the background tab, it bypasses the Page Visibility API and performs a 1-pixel micro-scroll every minute. If the prompt is found, it automatically clicks it, increments the live "Prevented" counter, and displays a "Pause Prevented!" notification on the widget.

🌐 Browser Support

This bookmarklet uses standard web APIs and pure DOM manipulation, making it fully compatible with all modern desktop browsers:

  • βœ… Google Chrome (Windows, macOS, Linux)
  • βœ… Mozilla Firefox
  • βœ… Microsoft Edge
  • βœ… Brave Browser
  • βœ… Opera / Opera GX
  • βœ… Safari (macOS)

Note: Mobile browsers generally do not support a traditional bookmarks bar for bookmarklets, so this tool is designed for desktop use.

πŸ‘¨β€πŸ’» For Developers

The code inside the installation button on the index.html page is minified to work effectively as a single-line bookmarklet.

If you want to read, review, or contribute to the source code, please check the ytm-keep-alive.js file. It contains the fully formatted, commented, and readable version of the script.

Note: All pull requests modifying the core logic should be applied to ytm-keep-alive.js first.

JavaScript HTML5 No Dependencies Open Source