GitHub Site-Wide Dark Mode

Fixes GitHub's dark mode not being enabled on Explore page, Marketplace, etc.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        GitHub Site-Wide Dark Mode
// @namespace   JunkiEDM/auto-dark-mode
// @match       https://github.com/*
// @grant       none
// @version     1.0
// @author      JunkiEDM
// @description Fixes GitHub's dark mode not being enabled on Explore page, Marketplace, etc.
// ==/UserScript==


window.addEventListener('load', function() {
    document.documentElement.setAttribute("data-color-mode", "dark")
    document.documentElement.setAttribute("data-dark-theme", "dark")
    document.evaluate('//*[@id="js-pjax-container"]/div[2]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.setAttribute("style", "/* background-color: #fcfdfd; */")
    document.evaluate('//*[@id="js-pjax-container"]/div[2]/div/div/div[2]/article[1]/div[3]/div/div', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.setAttribute("style", "background: linear-gradient(to top, var(--color-bg-canvas), rgba(255,255,255,0));")
}, false);