Prevent MissAV from pausing video when tab/window loses focus
MissAV Keep Playing On Blur 是一个用于 MissAV 的油猴脚本,用来防止网页在标签页失去焦点、窗口切换或最小化时自动暂停视频播放。
这个脚本会尝试拦截页面基于 blur 和 visibilitychange 的暂停逻辑,并关闭播放器可能启用的自动暂停行为,让视频在后台标签页或切换窗口后依然保持播放状态。
功能特点
• 防止切换标签页后视频自动暂停
• 防止窗口失去焦点后播放器停止播放
• 自动检测页面播放器并进行补丁处理
• 尽量保持原播放器行为,不影响正常手动暂停
• 无需额外依赖,安装后即可使用
适用场景
• 一边播放视频一边切换到其他页面
• 多任务处理时不希望视频被强制暂停
• 页面因失焦自动中断播放,影响连续观看体验
工作原理
脚本会在页面加载后检测播放器实例和视频元素,并通过以下方式减少失焦暂停:
• 修改页面可见性状态的相关属性返回值
• 拦截 visibilitychange / blur 事件传播
• 关闭播放器自动暂停配置(如可用)
• 重写播放器和视频元素的 pause() 行为,避免因失焦触发暂停
注意事项
• 由于站点播放器实现可能更新,脚本未来可能需要调整
• 某些浏览器策略或站点机制下,功能可能受限
• 本脚本仅用于改善后台播放体验,请自行遵守所在平台规则
⸻
MissAV Keep Playing On Blur is a Tampermonkey userscript for MissAV that prevents videos from being automatically paused when the tab loses focus, the window is blurred, or the browser is minimized.
The script works by intercepting pause logic related to blur and visibilitychange, and by disabling the player’s auto-pause behavior when possible, so playback can continue even when you switch tabs or move to another window.
Features
• Prevents videos from auto-pausing when switching tabs
• Keeps playback running when the browser window loses focus
• Automatically detects and patches the page player
• Preserves normal manual pause behavior as much as possible
• No external dependencies required
Use Cases
• Watching while browsing other tabs
• Keeping playback uninterrupted during multitasking
• Avoiding forced pauses caused by focus loss
How It Works
After the page finishes loading, the script looks for the player instance and video element, then reduces blur-triggered pauses by:
• Overriding document visibility-related properties
• Blocking visibilitychange and blur event propagation
• Disabling player auto-pause config when available
• Patching pause() on both the player and video element to ignore focus-loss pauses
Notes
• The script may require updates if the site’s player logic changes
• Some browser policies or site-side behaviors may still limit functionality
• This script is intended to improve background playback behavior; please use it in accordance with the platform’s rules