Я недавно заменил свой старый компьютер, и мне нужно было снова установить Firefox. Одной из главных вещей, которые я хотел восстановить, был скрипт Greasemonkey, который изменял цвет фона любого веб-сайта.
Поэтому меня немного раздражало, что я не смог найти тот, который использовал раньше. Короче говоря - вот тот, что с моего старого ПК.
Этот сценарий не моя собственная работа
Вся заслуга должна идти к Говарду Смиту. Первоначально он был размещен на Userscripts.org, который сейчас недоступен.
Просто создайте новый пользовательский скрипт в Greasemonkey и вставьте следующее в:
(function () {
    function noWhiteBackgroundColor() {
        function changeBackgroundColor(x)  {  // Auto change colors too close to white
            var backgroundColorRGB = window.getComputedStyle(x, null).backgroundColor;  // Get background-color
            if(backgroundColorRGB != "transparent")  {  // Convert hexadecimal color to RGB color to compare
                var RGBValuesArray = backgroundColorRGB.match(/\d+/g); // Get RGB values
                var red   = RGBValuesArray[0];
                var green = RGBValuesArray[1];
                var blue  = RGBValuesArray[2];
                // ============================================================================
                // Set the base colors you require:
                // Use: http://www.colorpicker.com
                // to find the RGB values of the base colour you wish to
                // suppress white backgrounds with:
                // Default gray provided:
                // ============================================================================
                var red_needed   = 220;
                var green_needed = 220;
                var blue_needed  = 255;
                if (red>=220 && green>=220 && blue>=220) { // White range detection
                   if (red>=250 && red<=255 && green>=250 && green<=255 && blue>=250 && blue<=255) {
                      red_needed   += 0;
                      green_needed += 0; }
                   else if (red>=240 && red<=255 && green>=240 && green<=255 && blue>=240 && blue<=255) {
                      red_needed   += 6;
                      green_needed += 3; }
                   else if (red>=230 && red<=255 && green>=230 && green<=255 && blue>=230 && blue<=255) {
                      red_needed   += 10;
                      green_needed += 5; }
                   else if (red>=220 && red<=255 && green>=220 && green<=255 && blue>=220 && blue<=255) {
                      red_needed   += 14;
                      green_needed += 7; }
                   x.style.backgroundColor = "rgb( " + red_needed + ", " + green_needed + ", " + blue_needed + ")"; // The background-color you want
               }
            }
        }
        var allElements=document.getElementsByTagName("*"); // Get all elements on a page
        for(var i=0; i<allElements.length; i++)  {
            changeBackgroundColor(allElements[i]);}
    }
    window.addEventListener("DOMContentLoaded",noWhiteBackgroundColor, false);
})();
Я использую это в течение почти двух лет и не могу вспомнить ни одного веб-сайта, который не смог изменить белый фон.