Created
December 18, 2020 10:01
-
-
Save MagicWinnie/280911518443073ded7588cf5df92d29 to your computer and use it in GitHub Desktop.
Dark Theme for SCP RU Branch
This file contains 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
// ==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