您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Inverts video if bright flashes are detected. YouTube-native toggle + settings panel.
Flashbank Protection
Flashbank Protection is a userscript designed to shield your eyes from sudden bright flashes in YouTube videos. It continuously analyzes visual brightness and inverts the video colors in real-time if it detects potentially harmful flashes.
🔧 How It Works
The script captures three thin horizontal stripes from each video frame: top, middle, and bottom.
Each stripe is scanned via an invisible for pixel brightness.
If ≥55% of any stripe's pixels exceed the brightness threshold (RGB ≥ 240), the video is inverted.
Inversion is automatically removed once brightness levels drop below the threshold.
A floating indicator (👁 Bright Flash Protection Active) is shown when protection is active.
Optionally displays a live debug canvas at the bottom for visual analysis.
▶️ Usage
Install the script using Violentmonkey or Tampermonkey.
It automatically detects video elements on YouTube pages and begins scanning every 250ms.
The YouTube-native Flashbank button (next to Like/Dislike) opens a settings panel:
Enable/disable script
Show/hide overlay
Toggle debug canvas
Adjust threshold
Toggle console logging
All settings are saved in localStorage and persist across sessions.
⚙️ Configuration
You can tweak detection behavior via script constants:
const DETECT_MODE = 'bright'; // 'bright' or 'gray'
const BRIGHT_THRESHOLD = 240;
const GRAY_TARGET = 80;
const TOLERANCE = 10;
const THRESHOLD_PERCENT = 55;
Use 'gray' mode to detect dark (gray) flashes instead of bright ones.
Adjust THRESHOLD_PERCENT to fine-tune sensitivity.
Modify BRIGHT_THRESHOLD or GRAY_TARGET for different light/dark detection cutoffs.
MIT Licensed.
Designed with comfort in mind.
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址