Greasy Fork

Greasy Fork is available in English.

Web Toon autoscroll

Automatically scroll through webcomics on webtoons

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Web Toon autoscroll
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Automatically scroll through webcomics on webtoons
// @author       NotACoder
// @match        https://www.webtoons.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Set the scroll speed (adjust as needed)
    var scrollSpeed = 1;

    // Variable to track whether scrolling is paused
    var isPaused = false;

    // Function to scroll the page automatically
    function autoScroll() {
        if (!isPaused) {
            window.scrollBy(0, scrollSpeed);
        }
    }

    // Toggle pause on "p" key press
    function togglePause() {
        isPaused = !isPaused;
    }

    // Set the interval for scrolling (adjust as needed)
    setInterval(autoScroll, 10); // Scroll every 1000 milliseconds (1 second)

    // Add event listener for "p" key press
    document.addEventListener('keydown', function(event) {
        if (event.key === 'p') {
            togglePause();
        }
    });

    // Add event listener for click on the page to pause
    document.addEventListener('click', function() {
        togglePause();
    });
})();