您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevent clicks below the red timeline scrolling, but allow control buttons to work
当前为
// ==UserScript== // @name YouTube - Block progress bar click scrolling // @namespace https://example.com // @version 1.1 // @description Prevent clicks below the red timeline scrolling, but allow control buttons to work // @match *://www.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; document.addEventListener('click', function(e) { // Allow the click if it originated on a control button (like pause, CC, settings, etc.) if (e.target.closest('.ytp-button')) { return; // do nothing, let it pass } // Get the progress bar container const progressBar = document.querySelector('.ytp-progress-bar-container'); if (!progressBar) return; // if not found, do nothing // Get the bounding rectangle of the progress bar const rect = progressBar.getBoundingClientRect(); // Define a small buffer (adjust if needed) const bufferPixels = 5; // If the click is below the progress bar plus buffer, block the event if (e.clientY > rect.bottom + bufferPixels) { e.stopPropagation(); e.preventDefault(); } }, true); })();