Tap to Scroll (Ignore Links)

Tap the top or bottom of the screen to scroll the page up or down, while ignoring taps on links and interactive elements.

2025-02-04 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Tap to Scroll (Ignore Links)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Tap the top or bottom of the screen to scroll the page up or down, while ignoring taps on links and interactive elements.
// @author       Your Name
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Define the threshold for tap zones (e.g., top 20% and bottom 20% of the screen)
    const tapZoneThreshold = 0.2; // 20% of the screen height

    document.addEventListener('click', function(event) {
        // Check if the tap is on an interactive element (e.g., link, button, input)
        const interactiveElements = ['A', 'BUTTON', 'INPUT', 'TEXTAREA', 'SELECT', 'LABEL'];
        if (interactiveElements.includes(event.target.tagName)) {
            return; // Ignore taps on interactive elements
        }

        const screenHeight = window.innerHeight;
        const tapY = event.clientY; // Y-coordinate of the tap

        // Determine if the tap is in the top or bottom zone
        if (tapY < screenHeight * tapZoneThreshold) {
            // Tap in the top zone: scroll up
            window.scrollBy({ top: -window.innerHeight * 0.8, behavior: 'smooth' });
        } else if (tapY > screenHeight * (1 - tapZoneThreshold)) {
            // Tap in the bottom zone: scroll down
            window.scrollBy({ top: window.innerHeight * 0.8, behavior: 'smooth' });
        }
    });
})();