diff options
author | Jesús <heckyel@hyperbola.info> | 2019-10-17 16:23:44 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-10-17 16:23:44 -0500 |
commit | ea5416b35f03f2558df64f383f1b4e1a4ae137fc (patch) | |
tree | 239bdb832fcd4f79c3b47ddb0ec7f5cd81ec956b | |
parent | 2139923a2e5995dd8c9686b0a64a9859dfcde66d (diff) | |
download | book-ea5416b35f03f2558df64f383f1b4e1a4ae137fc.tar.lz book-ea5416b35f03f2558df64f383f1b4e1a4ae137fc.tar.xz book-ea5416b35f03f2558df64f383f1b4e1a4ae137fc.zip |
[invidio_dark_mode] change syntax
-rw-r--r-- | scripts-greasemonkey/invidio_dark_mode.user.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts-greasemonkey/invidio_dark_mode.user.js b/scripts-greasemonkey/invidio_dark_mode.user.js index 24a93a9..312b140 100644 --- a/scripts-greasemonkey/invidio_dark_mode.user.js +++ b/scripts-greasemonkey/invidio_dark_mode.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Invidious - Dark Mode // @version 1.1.2 -// @author ace2k, Jesús E. +// @author Jesús E. // @license GPL-3.0 // @description This script automatically toggles dark mode on Invidious and its various public instances. // @namespace InvidiousDark @@ -18,12 +18,13 @@ // @grant none // ==/UserScript== -(function switchMode() { - 'use strict'; +window.addEventListener('load', () => { let consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;'; + let defaultMode = document.getElementsByClassName('ion-ios-moon')[0]; if (defaultMode != null) { defaultMode.click(); - console.log("%cUSERSCRIPT | " + GM_info.script.name + " " + GM_info.script.version + " | successfully initialized", consoleCSS); } -})(); + + console.log("%cUSERSCRIPT | " + GM_info.script.name + " " + GM_info.script.version + " | successfully initialized", consoleCSS); +}); |