Skip to content

Instantly share code, notes, and snippets.

@MagicWinnie
Created December 18, 2020 10:01
Show Gist options
  • Save MagicWinnie/280911518443073ded7588cf5df92d29 to your computer and use it in GitHub Desktop.
Save MagicWinnie/280911518443073ded7588cf5df92d29 to your computer and use it in GitHub Desktop.
Dark Theme for SCP RU Branch
// ==UserScript==
// @name Dark Theme for SCP RU Branch
// @namespace https://github.com/MagicWinnie
// @version 1.0
// @description Auto activates built-in dark theme on scpfoundation.net
// @author MagicWinnie
// @match http://scpfoundation.net/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
var darkThemeURL = "theme_fullname/theme:black";
var res = window.location.href;
if (res == "http://scpfoundation.net/" || res == "http://www.scpfoundation.net/")
res += "main/";
else if (res == "http://scpfoundation.net" || res == "http://www.scpfoundation.net")
res += "/main/";
if (!res.includes(darkThemeURL))
{
if (res.substr(res.length - 1) == '/')
location.replace(res + darkThemeURL);
else
location.replace(res + '/' + darkThemeURL);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment