YouTube No Scroll Down clicking blank space (Chapter Text Clickable Only)

Disable clicks on the ytp-chapter-container but keep text clickable, restore to original design and make clicking the player bar does nothing instead of scrolling down annoyingly

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         YouTube No Scroll Down clicking blank space (Chapter Text Clickable Only)
// @namespace    http://tampermonkey.net/
// @version      1.4.1
// @description  Disable clicks on the ytp-chapter-container but keep text clickable, restore to original design and make clicking the player bar does nothing instead of scrolling down annoyingly
// @author       Ed
// @license      BSD-3-Clause
// @match        *://*.youtube.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Inject custom CSS
    GM_addStyle(`
        :not(.ytp-exp-bottom-control-flexbox) .ytp-chapter-container {
            pointer-events: none !important; /* Disable clicks on the container */
        }
        :not(.ytp-exp-bottom-control-flexbox) .ytp-chapter-container .ytp-button,
        :not(.ytp-exp-bottom-control-flexbox) .ytp-chapter-container .ytp-chapter-title-content {
            pointer-events: auto !important; /* Enable clicks on buttons and text content */
        }
    `);
})();