Greasy Fork is available in English.

canvas navigator

navigate left and right using arrow keys in canvas

Tính đến 04-12-2022. Xem phiên bản mới nhất.

  1. // ==UserScript==
  2. // @name canvas navigator
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description navigate left and right using arrow keys in canvas
  6. // @author icycoldveins
  7. // @icon none
  8. // @grant none
  9. // @license MIT
  10. // @match *://*.instructure.com/*
  11. // ==/UserScript==
  12. (function () {
  13. "use strict";
  14.  
  15. // detect if text has Previos or Next
  16. // if yes, click it
  17. // if no, do nothing
  18. //using left and right arrow keys
  19. // aria-label="Previous Module Item"
  20. document.addEventListener("keydown", function (event) {
  21. if (event.key == "ArrowLeft") {
  22. if (document.querySelector("[aria-label='Previous Module Item']")) {
  23. document.querySelector("[aria-label='Previous Module Item']").click();
  24. // Previous Module Item - opens in new window
  25.  
  26. }else if(document.querySelector("[aria-label='Previous Module Item - opens in new window']"))
  27. {
  28. document.querySelector("[aria-label='Previous Module Item - opens in new window']").click();
  29. }
  30. }
  31. if (event.key == "ArrowRight") {
  32. if (document.querySelector("[aria-label='Next Module Item']")) {
  33. document.querySelector("[aria-label='Next Module Item']").click();
  34. }
  35. else if(document.querySelector("[aria-label='Next Module Item - opens in new window']"))
  36. {
  37. document.querySelector("[aria-label='Next Module Item - opens in new window']").click();
  38. }
  39. }
  40. if (event.key == "s" && event.metaKey && event.shiftKey) {
  41. // download the file
  42. document.querySelector("[download='true']").click();
  43. }
  44. });
  45. })();