User:Killer9000/common.js

From wowdev
Revision as of 22:27, 14 May 2022 by Killer9000 (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
var elms = document.querySelectorAll("*[style]");
Array.prototype.forEach.call(elms, function(elm) {
  var clr = elm.style.background || "";
  // Remove all whitespace, make it all lower case
  clr = clr.replace(/\s/g, "").toLowerCase();
  console.log(elm.style.background);
  switch (clr)
  {
  case "#eee":
  case "rgb(238, 238, 238)":
    elm.style.background = "rgb(22, 22, 22)";
    console.log(elm.style.background);
    break;
  }
});