Greasy Fork

Next Chapter Shortcut

For Mangakakalot & Manganelo

目前为 2020-12-13 提交的版本。查看 最新版本

// ==UserScript==
// @name         Next Chapter Shortcut
// @namespace    https://greasyfork.org/en/users/55535-sllypper
// @version      0.2
// @description  For Mangakakalot & Manganelo
// @author       sllypper
// @match        https://mangakakalot.com/chapter/*
// @match        https://manganelo.com/chapter/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let buttons = document.getElementsByClassName('btn-navigation-chap')[0].childNodes;
    let nextButton = buttons[buttons.length-1];
    let prevButton = buttons.length != 2 ? null : buttons[0];

    document.addEventListener("keydown", event => {
        if (event.code === "KeyC") {
            nextButton.click();
        }
        if (event.code === "KeyZ" && prevButton != null) {
            prevButton.click();
        }
    })

})();