Dark mTurk Pages

inverts mturk page color

  1. // ==UserScript==
  2. // @name Dark mTurk Pages
  3. // @author you
  4. // @version 3.17
  5. // @description inverts mturk page color
  6. // @match https://www.mturk.com/*
  7. // @match https://www.mturk.com/mturk*
  8. // @copyright 2012+, You
  9. // @namespace https://greasyfork.org/users/2698
  10. // ==/UserScript==
  11.  
  12. javascript: (
  13. function () {
  14. // the css we are going to inject
  15. var css = 'html {-webkit-filter: invert(100%);' +
  16. '-moz-filter: invert(100%);' +
  17. '-o-filter: invert(100%);' +
  18. '-ms-filter: invert(100%); }',
  19. head = document.getElementsByTagName('head')[0],
  20. style = document.createElement('style');
  21. // a hack, so you can "invert back" clicking the bookmarklet again
  22. if (!window.counter) { window.counter = 1;} else { window.counter ++;
  23. if (window.counter % 2 == 0) { var css ='html {-webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }'}
  24. };
  25. style.type = 'text/css';
  26. if (style.styleSheet){
  27. style.styleSheet.cssText = css;
  28. } else {
  29. style.appendChild(document.createTextNode(css));
  30. }
  31. //injecting the css to the head
  32. head.appendChild(style);
  33. }());