Skip to content

Instantly share code, notes, and snippets.

@lainegrace
Last active April 4, 2023 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lainegrace/6a544d232bffc5193ee17a1405fd939e to your computer and use it in GitHub Desktop.
Save lainegrace/6a544d232bffc5193ee17a1405fd939e to your computer and use it in GitHub Desktop.
A simple userscript with one line of code that sets a cookie on youtube to disable autoplay and switch to the new material dark theme.
// ==UserScript==
// @name YouTube: Dark, No autoplay
// @description A simple userscript with one line of code that sets a cookie on youtube to disable autoplay and switch to the new material dark theme.
// @namespace https://github.com/lainegrace
// @version 1.0
// @author Laine
// @match *://www.youtube.com/*
// @exclude *://www.youtube.com/tv*
// @exclude *://www.youtube.com/embed/*
// @run-at document-start
// ==/UserScript==
(function() {
// f5=30030 disables autoplay
// f6=400 switches to the material dark theme
document.cookie="PREF=f5=30030&f6=400;path=/;domain=.youtube.com";
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment