input contrast

Force inputs colors on pages

目前为 2016-12-06 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name input contrast
  3. // @namespace config@gedweb.name
  4. // @description Force inputs colors on pages
  5. // @include *
  6. // @version 1.0.1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. list = document.querySelectorAll('input, select, textarea');
  11.  
  12. for (i = 0; i < list.length; i++) {
  13. if (document.defaultView.getDefaultComputedStyle(list[i]).backgroundColor == document.defaultView.getComputedStyle(list[i]).backgroundColor) {
  14. list[i].style.backgroundImage = "repeating-linear-gradient(-45deg, #f0f0f0, #f0f0f0 1px, #fefefe 2px, #fefefe 12px)";
  15. }
  16. if (document.defaultView.getDefaultComputedStyle(list[i]).color == document.defaultView.getComputedStyle(list[i]).color) {
  17. list[i].style.color = "#202020";
  18. }
  19. }