User:Killer9000/common.js

From wowdev
Revision as of 22:21, 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) {
  // Get the color value
  var clr = elm.style.background || "";
  console.log(clr);
  // Remove all whitespace, make it all lower case
  clr = clr.replace(/\s/g, "").toLowerCase();
   // Switch on the possible values we know of
  switch (clr)
  {
  case "#eee":
  case "rgb(238, 238, 238)":
    elm.style.background = "#000000";
    break;
  }
});