diff options
author | Jesús <heckyel@hyperbola.info> | 2020-07-05 16:41:54 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-07-05 16:41:54 -0500 |
commit | 7acf613c585f2b50df854876cdb6aa435af30ddc (patch) | |
tree | ad2133ea80355debf7024a98d9578d888ee3d58c | |
parent | 3b0c8942748885b7cd21d03a7aad7967fe209698 (diff) | |
download | book-7acf613c585f2b50df854876cdb6aa435af30ddc.tar.lz book-7acf613c585f2b50df854876cdb6aa435af30ddc.tar.xz book-7acf613c585f2b50df854876cdb6aa435af30ddc.zip |
scripts-greasemonkey: invidio_dark_theme, improve log message
-rw-r--r-- | scripts-greasemonkey/invidio_dark_mode.user.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts-greasemonkey/invidio_dark_mode.user.js b/scripts-greasemonkey/invidio_dark_mode.user.js index 2a03957..4483bf1 100644 --- a/scripts-greasemonkey/invidio_dark_mode.user.js +++ b/scripts-greasemonkey/invidio_dark_mode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Invidious - Dark Mode -// @version 1.1.6 +// @version 1.1.7 // @author Jesús E. // @license GPL version 3 or any later version::: https://www.gnu.org/licenses/gpl-3.0.html // @description This script automatically toggles dark mode on Invidious and its various public instances. @@ -21,12 +21,16 @@ // ==/UserScript== window.addEventListener('load', () => { - let consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;'; + const consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;'; + const name = GM_info.script.name; + const version = GM_info.script.version; + const log = (...args) => console.log('%cUSERSCRIPT | %s %s | %s', consoleCSS, name, version, ...args); - let defaultMode = document.getElementsByClassName('ion-ios-moon')[0]; - if (defaultMode != null) { - defaultMode.click(); - } + log('successfully initialized'); - console.log("%cUSERSCRIPT | " + GM_info.script.name + " " + GM_info.script.version + " | successfully initialized", consoleCSS); + let defaultMode = document.getElementsByClassName('ion-ios-moon')[0]; + if (defaultMode != null) { + defaultMode.click(); + log('Dark theme ready!'); + } }); |