Greasy Fork is available in English.

Hotkeys for webtoons.com navigation 2023

Add navigation hotkeys for Webtoons.com

// ==UserScript==
// @name         Hotkeys for webtoons.com navigation 2023
// @namespace    https://github.com/ChristopherLeitner
// @license      MIT
// @version      1.0
// @description  Add navigation hotkeys for Webtoons.com
// @author       CodeFox
// @match        https://www.webtoons.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

document.addEventListener('keydown', function(event) {
    if (event.code === 'ArrowRight') {
        var nextBtn = document.querySelector("[class*='pg_next']");
        if (nextBtn) {
          	console.log("Going to next page");
            nextBtn.click();
        }
    }
    if (event.code === 'ArrowLeft') {
        var prevBtn = document.querySelector("[class*='pg_prev']");
        if (prevBtn) {
            prevBtn.click();
        }
    }
}, true);