Last active
May 22, 2020 21:37
-
-
Save bergpb/2fddbc689a421adb30af85a3bd126a6b to your computer and use it in GitHub Desktop.
Tampermonkey script to turn on dark mode in whatsappweb based on current time
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_mode_whatsappweb | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Activate dark mode in https://web.whatsapp.com/ | |
// @author https://github.com/bergpb | |
// @match https://web.whatsapp.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var time = (new Date()).getHours(); | |
const dayTime = time > 6 && time < 18; | |
if(!dayTime){ | |
console.log("It's a darkness night"); | |
document.body.classList.add("dark"); | |
} else { | |
console.log("It's a shining day"); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Firefox 77.0b9 (64-bit), Tampermonkey 4.10.6112, Microsoft Windows 10.0.18363.836, WhatsApp Messenger (Beta) 2.20.157 - OK. However, it is a pity that the topic is dark, not black. That is, the predominant colors are dirty green, gray.