Project Endor (Jamelio) Keybinds

Make keybinds for the Project Endor (Jamelio) voice recording hits.

  1. // ==UserScript==
  2. // @name Project Endor (Jamelio) Keybinds
  3. // @namespace https://github.com/Kadauchi/
  4. // @version 2.0.0
  5. // @description Make keybinds for the Project Endor (Jamelio) voice recording hits.
  6. // @author Kadauchi
  7. // @icon http://i.imgur.com/oGRQwPN.png
  8. // @include https://www.google.com/evaluation/endor/*
  9. // @grant GM_log
  10. // ==/UserScript==
  11.  
  12. function MOUSEDOWN (element) {
  13. const event = document.createEvent(`MouseEvents`);
  14. event.initEvent(`mousedown`, true, true);
  15. element.dispatchEvent(event);
  16. }
  17.  
  18. window.addEventListener(`keydown`, function (event) {
  19. switch(event.key) {
  20. case `1`:
  21. MOUSEDOWN(document.querySelectorAll(`div[id^=g]`)[0].children[0].children[0]);
  22. break;
  23. case `2`:
  24. MOUSEDOWN(document.querySelectorAll(`div[id^=g]`)[1].children[0].children[0]);
  25. break;
  26. case `3`:
  27. document.querySelector(`[type='submit']`).click();
  28. break;
  29. }
  30. });
  31.  
  32. window.focus();