您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
停用Youtube迷你播放器功能
当前为
// ==UserScript== // @name Youtube停用迷你播放器 // @namespace https://gf.qytechs.cn/scripts/436314 // @version 1.2 // @description 停用Youtube迷你播放器功能 // @author fmnijk // @match https://www.youtube.com/* // @icon https://www.google.com/s2/favicons?domain=youtube.com // @grant GM_addStyle // @license MIT // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js // ==/UserScript== /*main function*/ (function() { 'use strict'; /*修改locationchange監聽器*/ modlocationchange(); /*停用迷你播放器*/ disableminiplayer(); })(); /*定時器*/ function setIntervalX(callback, delay, maxrepeate) { var count = 0; var intervalID = window.setInterval(function () { callback(); if (++count === maxrepeate) { window.clearInterval(intervalID); } }, delay); } function setIntervalY(callback, isfinish, delay, maxrepeate) { var count = 0; var intervalID = window.setInterval(function () { callback(); if (isfinish() || ++count === maxrepeate) { window.clearInterval(intervalID); } }, delay); } /*修改locationchange監聽器*/ function modlocationchange(){ history.pushState = ( f => function pushState(){ var ret = f.apply(this, arguments); window.dispatchEvent(new Event('pushstate')); window.dispatchEvent(new Event('locationchange')); return ret; })(history.pushState); history.replaceState = ( f => function replaceState(){ var ret = f.apply(this, arguments); window.dispatchEvent(new Event('replacestate')); window.dispatchEvent(new Event('locationchange')); return ret; })(history.replaceState); window.addEventListener('popstate',()=>{ window.dispatchEvent(new Event('locationchange')) }); } /*停用迷你播放器*/ function disableminiplayer() { var styles = ` /*屏蔽迷你播放器*/ body > ytd-app > ytd-miniplayer{ display: none !important; pointer-events:none !important; } /*屏蔽開啟迷你撥放器按鈕*/ #movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-right-controls > button.ytp-miniplayer-button.ytp-button{ display: none !important; pointer-events:none !important; } ` GM_addStyle(styles); setIntervalY(trydisableminiplayer, isdisableminiplayer, 100, 50); window.addEventListener('locationchange', function(){ setIntervalY(trydisableminiplayer, isdisableminiplayer, 100, 50); }) } function trydisableminiplayer() { $('.ytp-miniplayer-close-button.ytp-button')?.click(); } function isdisableminiplayer() { if (window.location.href != 'https://www.youtube.com/'){ return true; } return false; }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址