Webtoons navigator

Function for navigating chapters in webtoon reader using left and right arrow button and hearting the chapter using the 'h' (for Heart) button.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Webtoons navigator
// @icon         https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Naver_Line_Webtoon_logo.png/128px-Naver_Line_Webtoon_logo.png
// @version      0.2
// @description  Function for navigating chapters in webtoon reader using left and right arrow button and hearting the chapter using the 'h' (for Heart) button.
// @author       Mr. M
// @match        https://www.webtoons.com/en/*/*/*/*
// @grant        none
// @namespace    https://greasyfork.org/users/553660
// ==/UserScript==

(function() {
    'use strict';

    document.onkeydown = checkKey;

    function checkKey(e) {

        e = e || window.event;

        if (e.keyCode == '37') {
            var x = document.getElementsByClassName("_prevEpisode");
            window.location = x[0].getAttribute("href");
        }
        else if (e.keyCode == '39') {
            var y = document.getElementsByClassName("_nextEpisode");
            window.location = y[0].getAttribute("href");
        }
        else if (e.keyCode == '72') {
            document.getElementById("likeItButton").click();
        }

}
})();