Greasy Fork

Manganelo/Mangakakalot Left/Right Arrow Key Navigation

left and right arrow key navigation to the previous or next manga in the series

目前为 2019-12-25 提交的版本。查看 最新版本

// ==UserScript==
// @name     Manganelo/Mangakakalot Left/Right Arrow Key Navigation
// @author  sm00nie
// @version  1.03
// @description left and right arrow key navigation to the previous or next manga in the series
// @grant    none
// @include /^https?:\/\/(?:www\.)?(manganelo\.com|mangakakalot\.com)(?:.*)$/
// @namespace https://greasyfork.org/users/165048
// ==/UserScript==
(function() {
    'use strict';
    let next, previous;

    document.addEventListener("keyup", function(event) {
            previous = document.querySelector('.next') || document.querySelector('.navi-change-chapter-btn-prev');
            next = document.querySelector('.back') || document.querySelector('.navi-change-chapter-btn-next');
        if (event.keyCode == 37 && previous !== null) {
            previous.click()
        } else if(event.keyCode == 39 && next !== null) {
            next.click()
        }
    })
})();