Flashbank Protection (YouTube UI + Settings)

Inverts video if bright flashes are detected. YouTube-native toggle + settings panel.

作者
Björn Trier
日安装量
1
总安装量
3
评分
1 0 0
版本
3.1
创建于
2025-06-07
更新于
2025-06-07
大小
10.5 KB
许可证
MIT
适用于

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或关注我们的公众号极客氢云获取最新地址