This script changes Youtube's theme to dark mode by changing preferences via cookie.
Earlier, you could change YT's theme instantly by clicking the theme button.
A few weeks back, Youtube changed their site so when you click the dark mode button, it now reloads the page to change the theme instead of doing it instantly like it used to.
My browser clears cookies frequently, so I find this extra reload + waiting time very annoying
So i automated it, when youtube loads and it doesnt detect the dark mode preference value in the cookie, the script adds it and forces a reload.
Much tolerable than manually clicking the dark mode buttong and waiting for it to finish reloading ;)