>Форум Mozilla Россия http://forum.mozilla-russia.org/index.php >Скрипты http://forum.mozilla-russia.org/viewforum.php?id=37 >No White Background - Замена белого цвета http://forum.mozilla-russia.org/viewtopic.php?id=68820 |
jars > 23-11-2015 17:44:28 |
Скрипт заменяет белый цвет элементов страницы на серый. Всех элементов. Цвет нужный можно выставить самому. на ... и всё заработало. скрытый текст Выделить код Код:// ==UserScript== // @id noWhiteBackgroundColor-gray // @name noWhiteBackgroundColor-gray Заменить белый цвет на странице // @version 2.0 // @author HowardSmith // @namespace // @description Version 2: Generic version which can now be configured to any background colour you like: // @include * // @exclude http*://images.search.yahoo.com/* // @run-at document-start // ==/UserScript== (function (nwb) { 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 hex 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 = 228; var green_needed = 228; var blue_needed = 228; 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("load",noWhiteBackgroundColor, false); // })() ; Вверху ссцылка на ориг авторский скрипт, не закоментированный и с "DOMContentLoaded" . |
Ultima2m > 23-11-2015 18:39:24 |
Неплохой скрипт. Особенно понравилась возможность добавления оттенков. Я использую сейчас Change Background Color, |
jars > 23-11-2015 19:35:39 |
Ultima2m > 24-11-2015 09:32:51 |
У меня не работает |
jars > 25-11-2015 06:45:08 |
Ultima2m Поставь в настройках бравзера Цвет "серенький" и будет Userstyles серенький тоже 25-11-2015 06:46:04 |
Ultima2m > 25-11-2015 07:21:26 |
jars |
jars > 25-11-2015 19:50:56 |
nabigator > 25-11-2015 20:30:17 |
userContent.css нет? я там вырубил тупые фоновые пикчи например и рад) |
jars > 25-11-2015 21:13:33 |
nabigator пишет
Ага, аналогично. можно еще тудаже вписать background-color и просто background без !important, но это вроде будет тоже самое что эта настройка в about:config. |
nabigator > 25-11-2015 21:56:25 |
jars, ты почти как линуксоид! Ну чувствуется знакомый подход к реалиям |
Ultima2m > 30-11-2015 06:17:09 |
Заметил, что на некоторых сайтах изображение кнопок ломается. Как исправить? |