您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A tool to eliminate web video player overlays with Shift+D.
当前为
Shift-D
to toggle all the "floating elements" overlaying the video player (controls, danmaku, etc.)
Shift-D
を押すと、ビデオプレーヤーに重なるすべての「フローティング要素」がトグル切り替わります(コントロールや弾幕など)。
This userscript is designed to hide the overlay of any video player on a webpage. It does this by adding a new style to the webpage, which makes any overlay elements invisible. This script works by listening for changes in the webpage's DOM and checking for new elements that may be overlays on the video player.
Below is a detailed breakdown of what each part of the script does:
keyCombination
: This is a key combination (shift + KeyD) that when pressed, will trigger the script to check for overlays on the video player and hide them.
addStyle
: This function takes a string argument, which is the CSS to be added to the webpage. This CSS makes any overlay elements collapse (become invisible).
callbackA
, callbackB
, and callbackBmicro1
: These are callbacks that are invoked when the webpage's DOM changes (new elements are added). They check if the new element is an overlay, and if so, they add it to a list of elements to hide.
MutationObserver
: This is an object that observes changes in the webpage's DOM. When a new element is added, it triggers callbackA
.
resizeCallback
and makeHide
: These functions are invoked when the video player is resized. They adjust the hiding of overlays to the new size of the video player.
getVideoState
: This function checks the current state of the video player, including its size and whether it is playing.
postMessage
and spreadMessage
: These functions are used to send a message to all iframes in the webpage. The message is used to trigger the hiding of overlays in the iframe.
tryUnhide
: This function is used to attempt to unhide the overlay. It is invoked when the key combination is pressed and no overlays are currently hidden.
keydown
event listener: This event listener listens for when the key combination is pressed. When it is, it either unhides the overlays (if they are currently hidden) or hides them (if they are not).
video-controls-hidden675
event listener: This event listener listens for a custom event that is dispatched when the video player is resized. When this event is fired, it re-hides the overlays.
The script runs on all websites (@match https://*/*
) except those explicitly excluded, such as live chats on YouTube (@exclude https://www.youtube.com/live_chat*
) and certain file types (@exclude /^https?://\S+\.(txt|png|jpg|jpeg|gif|xml|svg|manifest|log|ini)[^\/]*$/
).
Please note that userscripts like this can sometimes interfere with the functionality of websites, so use with caution. Always ensure you trust the source of the script and understand what it does before installing it.
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址