Disable pull to refresh

Disables pull to refresh

目前為 2024-04-19 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Disable pull to refresh
// @namespace   disablepullrefresh
// @match       *
// @grant       none
// @version     1.5
// @run-at      document-end
// @author      ab498
// @description Disables pull to refresh
// ==/UserScript==

document.addEventListener('touchmove', function(event) {
    // Check if the user is at the top of the page
    if (window.pageYOffset === 0) {
        // Prevent the default action (e.g., pull-to-refresh)
        event.preventDefault();
    }
}, { passive: false });