禁用移动端浏览器下拉刷新(Kiwi浏览器等)
// ==UserScript==
// @name 禁用移动端浏览器下拉刷新
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 禁用移动端浏览器下拉刷新(Kiwi浏览器等)
// @author Ymmzy
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
var lastY = 0;
window.addEventListener('touchmove', function (e) {
var scrolly = window.pageYOffset || window.scrollTop || 0;
var direction = e.changedTouches[0].pageY > lastY ? 1 : -1;
if (direction > 0 && scrolly === 0) {
e.preventDefault();
}
lastY = e.changedTouches[0].pageY;
}, {passive: false});
})();