Github auto dark mode

12/16/2020, 7:09:34 PM

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Github auto dark mode
// @namespace   kamikazechaser/auto-dark-mode
// @match       https://github.com/*
// @grant       none
// @version     1.0
// @author      kamikazechaser
// @description 12/16/2020, 7:09:34 PM
// ==/UserScript==


window.addEventListener('load', function() {
    const now = new Date();
    if (now.getHours() > 18) document.documentElement.setAttribute("data-color-mode", "dark")
}, false);