Siguiente capitulo

Cambiar de capitulos en TMO con las flechas del teclado

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Siguiente capitulo
// @namespace    http://tampermonkey.net/
// @license      GNU GPLv3
// @version      0.1
// @description  Cambiar de capitulos en TMO con las flechas del teclado
// @author       MarKazu
// @match        https://*.com/*/*/cascade
// @match        https://*.com/*/*/paginated/*
// @match        https://lectortmo.com/viewer/*/paginated
// @match        https://lectortmo.com/viewer/*/cascade
// @icon         https://www.google.com/s2/favicons?domain=lectortmo.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    //Verificamos si nos encontramos, en el capitulo, de forma pagina
    if(window.location.href.includes("paginated")){
        /*
        En caso afirmativo, reemplazamos el "paginated" por "cascade" para ver
        todas las imagenes del capitulo
        */
        window.location = window.location.href.replace("paginated", "cascade");
    }
    //ponemos un evento 'Keydown' para verificar que letra se presiono
    document.addEventListener('keydown', logKey);
    function logKey(e) {
        //si la tecla que presionamos es la flecha derecha
        if(e.code == "ArrowRight"){
            /*
            Declaramos la variable siguiente, que contiene el div con el elemento a
            que contiene el enlace al siguiente capitulo.
            */
            let siguiente = document.querySelector(".chapter-next");
            /*
            Utilizamos el window.location para poder redireccionar al capitulo siguiente
            */
            window.location = siguiente.querySelector("a").href;
        }
        if(e.code == "ArrowLeft"){
            /*
            Declaramos la variable anterior, que contiene el div con el elemento a
            que contiene el enlace al capitulo anterior.
            */
            let anterior = document.querySelector(".chapter-prev");
            /*
            Utilizamos el window.location para poder redireccionar al capitulo anterior
            */
            window.location = anterior.querySelector("a").href;
        }
    }
})();