YouTube Prevent Playlist Autoplay

Allows the user to toggle autoplaying to the next video once the current video ends. Stores the setting locally.

These are versions of this script where the code was updated. Show all versions.

  • v1.5.1 2023-12-12
  • v1.5.0 2023-12-12

    Fixed controlling autoplay not functioning (Credit to 𝖢𝖸 𝖥𝗎𝗇𝗀) and added basic Mixes support.

  • v1.4.0 2022-02-18

    Reworked the logic to keep the toggle button visible in the main playlist sidebar. (It still only appears in the miniplayer after a navigation action while visible.)

  • v1.3.2 2022-02-13

    Toggle will appear on the first load of a playlist video page. Unsure at the moment how to consistently add it since YouTube changes.

  • v1.3.1 2021-10-12

    Undid previous change and added run-at property set to document-start, as events were firing before the script could initially.

  • v1.3 2021-10-09

    Changing the initial hook event as the previous one was not working (at least in Firefox). Commented out in case it might still be needed by anyone.

  • v1.2.6 2021-06-19

    Changing missing header warning to only display when debugging to prevent console spam.

  • v1.2.5 2021-05-27

    Removed repetitive debug console message relating to placement of the switch.

  • v1.2.4 2021-05-22

    YouTube added a "computed" field, whereas the old one may be hidden. This fixes the script to point to the visible field. Commented the old selectors for now.

  • v1.2.3 2021-05-19

    Hover text on the switch now states if autoplay is on or off. Added more irrelevant YouTube subsites to the exclusions. Rewrote some console logs and descriptive comments.

  • v1.2.2 2021-03-25

    Minor Fix - Tabs back to Spaces.
    Previous Fix: null check, comment, and typo.

  • v1.2.1 2021-03-25
  • v1.2 2020-11-21 Toggle/Switch is now built with HTML/CSS instead of two static images. This allows for smooth transition between off/on and the ability for users to style it.
  • v1.1 2020-11-21 Somewhat more efficient header search.
  • v1.0 2020-11-20 Toggle button for autoplay is now embedded in the playlist header. The current status of autoplay is now stored and maintained when the site is loaded.
  • v0.9.2 2020-11-05 Mostly additional info.
  • v0.9.1 2020-11-05 Clearer description
  • v0.9.1 2020-11-05