您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
YouTube 视频播放器网页全屏,仅针对剧场模式有效,请先按 t 进入剧场模式,按 n 快捷键触发(再次按 n 可取消全屏)
当前为
// ==UserScript== // @name YouTube播放器网页全屏 // @namespace http://tampermonkey.net/ // @version 1.0.1 // @description YouTube 视频播放器网页全屏,仅针对剧场模式有效,请先按 t 进入剧场模式,按 n 快捷键触发(再次按 n 可取消全屏) // @author meteora // @match https://www.youtube.com/* // @match https://www.youtube.com // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // @license MIT // ==/UserScript== ;(() => { // 创建全屏按钮样式 const style = document.createElement("style") style.textContent = ` .webpage-fullscreen { position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100vh !important; max-width: none !important; max-height: none !important; z-index: 9999 !important; background: black; } ` document.head.appendChild(style) let isWebpageFullscreen = false document.addEventListener("keydown", function (event) { // 忽略在输入框中的按键事件 if ( event.target.tagName === "INPUT" || event.target.tagName === "TEXTAREA" ) { return } // 按键盘 n 触发 if (event.key === "n") { const videoContainer = document.getElementById("full-bleed-container") if (!videoContainer) return isWebpageFullscreen = !isWebpageFullscreen if (isWebpageFullscreen) { videoContainer.classList.add("webpage-fullscreen") } else { videoContainer.classList.remove("webpage-fullscreen") } // 模拟屏幕尺寸变化,让播放器大小自适应 window.dispatchEvent(new Event("resize")) // 阻止默认行为 event.preventDefault() } }) })()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址