键盘翻页onejav.com

2024/6/4 10:24:10

// ==UserScript==
// @name        键盘翻页onejav.com
// @namespace   Violentmonkey Scripts
// @match       https://onejav.com/*
// @grant       none
// @version     1.0
// @author      -
// @description 2024/6/4 10:24:10
// ==/UserScript==
(function(){
  let prevColl = document.getElementsByClassName('pagination-previous button is-primary')
  let $prev = prevColl.length>0?prevColl[0]:false
  let nextColl = document.getElementsByClassName('pagination-next button is-primary')
  let $next = nextColl.length>0?nextColl[0]:false

  document.addEventListener('keydown',  function(event) {
    if($prev&&event.code === 'ArrowLeft') $prev.click()
    if($next&&event.code === 'ArrowRight') $next.click()
  })

})()