🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Youtube Mobile Toggle Show Controls Overlay

Adds a button below player to show/hide controls on hover

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         Youtube Mobile Toggle Show Controls Overlay
// @version      1
// @grant        none
// @match        https://m.youtube.com/watch*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @description  Adds a button below player to show/hide controls on hover
// @namespace    asleepysamurai.com
// @license      BSD Zero Clause License
// ==/UserScript==

(function() {
    'use strict';
    const done = false

    function init(){
        const player = document.querySelector('.watch-below-the-player')
        if(!player){
            setTimeout(init, 300)
            return
        }

        let showingControls = true
        const button = document.createElement('button')
        button.addEventListener('click',()=>{
            document.querySelector('#player-control-container').setAttribute('style',`display:${showingControls? 'none':'inherit'} !important`);
            button.innerText = `${showingControls ? 'Hide': 'Show'} Controls`
            showingControls = !showingControls
        })
        button.innerText="Hide Controls"
        button.setAttribute('style','font-size:x-large;padding:10px 20px')

        player.before(button)
    }

    init();
})();