mashibing next episode control

key listener ESC

目前为 2024-08-25 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name mashibing next episode control
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024年8月25日22点15分
  5. // @description key listener ESC
  6. // @license MIT
  7. // @author onionycs
  8. // @match https://www.mashibing.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=mashibing.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Your code here...
  17. document.addEventListener('keydown', function(event) {
  18.  
  19. if (event.key === 'Escape') {
  20. document.getElementsByClassName('next-btn')[1].click();
  21. }
  22.  
  23. if (event.key === ']') {
  24. document.getElementsByClassName('next-btn')[0].click();
  25. }
  26. });
  27.  
  28. })();