Last active
January 21, 2018 12:19
-
-
Save cecekpawon/a8456190dcf6d04fb7bb9b98639db476 to your computer and use it in GitHub Desktop.
Youtube Darkmode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// ==UserScript== | |
// @name Youtube Darkmode | |
// @namespace https://github.com/cecekpawon | |
// @author cecekpawon (THRSH) | |
// @description Youtube Darkmode, thanks internet! | |
// @version 1.0 | |
// @grant none | |
// @match https://*.youtube.com/* | |
// @run-at document-start | |
// ==/UserScript== | |
var FF = /Firefox/.test(navigator.userAgent); | |
var DarkmodeVal1 = "fPQ4jCL6EiE"; | |
var DarkmodeVal2 = "f6=400"; | |
var DarkmodeVal3 = ";domain=.youtube.com;path=/"; | |
var DarkmodeInit1 = document.cookie.match(new RegExp(DarkmodeVal1)); | |
var DarkmodeInit2 = document.cookie.match(new RegExp(DarkmodeVal2)); | |
if (!DarkmodeInit1 || !DarkmodeInit2) { | |
document.cookie = "VISITOR_INFO1_LIVE=" + DarkmodeVal1 + (FF ? "" : DarkmodeVal3); | |
document.cookie = "PREF=" + DarkmodeVal2 + (FF ? "" : DarkmodeVal3); | |
location.reload(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you make scripts that set a timer to automatically pause/stop on all Youtube embed videos? Like pause a video after X seconds!!?