Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.