Youtube Control Hider

Removes the controls bar when paused when h button is pressed

目前为 2023-08-27 提交的版本。查看 最新版本

// ==UserScript==
// @name         Youtube Control Hider
// @namespace    http://tampermonkey.net/
// @version      0.11
// @description  Removes the controls bar when paused when h button is pressed
// @author       Kaanium
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var _top = document.querySelector(".ytp-chrome-top");
    var top_grad = document.querySelector(".ytp-gradient-top");
    var _bottom = document.querySelector(".ytp-chrome-bottom");
    var bottom_grad = document.querySelector(".ytp-gradient-bottom");

    var elementsHidden = false;

    document.addEventListener('keydown', function(event) {
        if (event.key === "h") {
            if (elementsHidden) {
                _top.style.visibility = 'visible';
                top_grad.style.visibility = 'visible';
                _bottom.style.visibility = 'visible';
                bottom_grad.style.visibility = 'visible';
            } else {
                _top.style.visibility = 'hidden';
                top_grad.style.visibility = 'hidden';
                _bottom.style.visibility = 'hidden';
                bottom_grad.style.visibility = 'hidden';
            }
            elementsHidden = !elementsHidden;
        }
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址