input contrast

Force inputs colors on pages

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

  1. // ==UserScript==
  2. // @name input contrast
  3. // @namespace config@gedweb.name
  4. // @description Force inputs colors on pages
  5. // @include *
  6. // @version 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.backgroundColor = "#f8f8f8";
  15. }
  16. if (document.defaultView.getDefaultComputedStyle(list[i]).color == document.defaultView.getComputedStyle(list[i]).color) {
  17. list[i].style.color = "#202020";
  18. }
  19. }