Google Docs Dark Theme

Make Google Docs a bit darker

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Google Docs Dark Theme
// @namespace    googleDarkTheme
// @version      0.3
// @description  Make Google Docs a bit darker
// @author       JetDave
// @match        https://docs.google.com/document/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.body.style.filter = "invert(0.9)";
    window.addEventListener("DOMNodeInserted",invertImgs);
    window.addEventListener("load",invertImgs)
    // kix-embeddedobject-image
    function invertImgs(){
        var elms = document.getElementsByTagName("img");
        for(let elm of elms){
            elm.style.filter = "invert(1)";
        }
        var elms2 = document.getElementsByClassName("kix-spelling-error-overlay");
        for(let elm of elms2){
            elm.style.filter = "invert(1)";
        }
        var elms3 = document.getElementsByClassName("kix-embeddedobject-image");
        for(let elm of elms3){
            elm.style.filter = "invert(1)";
        }
        var elms4 = document.getElementsByClassName("link-bubble-thumbnail-image");
        for(let elm of elms4){
            elm.style.filter = "invert(1)";
        }
    }
})();