好きなところを
ダブルタップでトップに
長押しで一番下に
// ==UserScript==
// @name Quick Scroll Top/Bottom
// @namespace local
// @version 1.0
// @description Double tap to top, long press to bottom on any page
// @match *://*/*
// @run-at document-end
// @grant none
// ==/UserScript==

(function() {
// ダブルタップでトップにスクロール
let lastTap = 0;
document.addEventListener('touchend', function(e) {
const currentTime = new Date().getTime();
const tapLength = currentTime - lastTap;
if (tapLength < 300 && tapLength > 0) { // 300ms以内の2回タップ
window.scrollTo({ top: 0, behavior: 'smooth' });
e.preventDefault();
}
lastTap = currentTime;
}, false);

// 長押しでボトムにスクロール
let pressTimer;
document.addEventListener('touchstart', function(e) {
pressTimer = setTimeout(() => {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
}, 500); // 0.5秒長押しで発動
}, false);

document.addEventListener('touchend', function(e) {
clearTimeout(pressTimer);
}, false);
})();