Greasy Fork 还支持 简体中文。

GoComics control with arrow keys

Use arrow keys to go back and forth on comics on GoComics

目前為 2024-06-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name GoComics control with arrow keys
  3. // @namespace https://github.com/AbdurazaaqMohammed/userscripts
  4. // @version 1.0
  5. // @description Use arrow keys to go back and forth on comics on GoComics
  6. // @author Abdurazaaq Mohammed
  7. // @license The Unlicense
  8. // @homepage https://github.com/AbdurazaaqMohammed/userscripts
  9. // @supportURL https://github.com/AbdurazaaqMohammed/userscripts/issues
  10. // @match https://www.gocomics.com/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. document.addEventListener('keydown', function(e) {
  18. const key = e.key;
  19. if (key == "ArrowLeft") document.querySelector('.js-previous-comic.sm.fa-caret-left.btn-circle.btn-outline-secondary.btn.fa').click(); //Go to previous comic release
  20. else if (key == "ArrowRight") document.querySelector('.sm.fa-caret-right.btn-circle.btn-outline-secondary.btn.fa').click();//Go to next comic release
  21. // You can add more keys or change them as you want. The documentation for key values can be found here: https://developer.mozilla.org/en-US/docs/web/api/ui_events/keyboard_event_key_values
  22. });
  23. })();