Show Autoplay Button on YouTube

Forces YouTube autoplay toggle to be visible

Author
TechnicalGlitch
Daily installs
0
Total installs
0
Ratings
0 0 0
Version
1.0
Created
2025-05-06
Updated
2025-05-06
Size
917 Bytes
License
MIT
Applies to

Purpose

This userscript ensures that the Autoplay toggle button on YouTube remains visible at all times by forcing its display via a CSS rule.

YouTube sometimes hides the Autoplay toggle depending on screen size, playback context, or internal UI updates. This script ensures the element with aria-label~="Autoplay" is always displayed.


Features

  • Forces [aria-label~="Autoplay"] to use display: inline !important.
  • Injects CSS early (document-start) for maximum consistency.
  • Automatically re-injects style if YouTube dynamically changes the DOM (SPA behavior).
  • Lightweight and efficient.

How It Works

  • A <style> element containing the CSS rule is injected into the document <head>.
  • A MutationObserver monitors DOM changes and ensures the CSS persists through YouTube's single-page navigation system.
  • Uses a custom data-autoplay-fix attribute to prevent multiple injections.

Installation

  1. Install Tampermonkey or Violentmonkey.
  2. Click "Install" on this script page.
  3. Visit YouTube and the Autoplay toggle will now always be visible.

⚠ Notes

  • If YouTube changes its aria-label for the autoplay button (e.g., localizing it or renaming it), you may need to update the selector.
  • This script is designed for the default (English) YouTube UI.