BG color Fix

This userscript fixes the BG color not being set and you needing to click a preset first.

  1. // ==UserScript==
  2. // @name BG color Fix
  3. // @namespace bg_color_fix_owot
  4. // @version 1
  5. // @description This userscript fixes the BG color not being set and you needing to click a preset first.
  6. // @author e_g.
  7. // @match https://*.ourworldoftext.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=ourworldoftext.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. function updateBgColor(){
  13. w.changeBgColor(parseInt(document.getElementsByClassName("jscolor")[1].value, 16) || -1);
  14. }
  15. let bgColorModal = document.getElementsByClassName("modal_client")[4];
  16. bgColorModal.firstChild.lastChild.firstChild.addEventListener("click", updateBgColor);
  17. bgColorModal.onkeydown = function(e){
  18. if(checkKeyPress(e, "ENTER")) updateBgColor();
  19. }