🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Flashbank Protection (YouTube UI + Settings)

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Author
Björn Trier
Daily installs
0
Total installs
4
Ratings
1 0 0
Version
3.1
Created
2025-06-07
Updated
2025-06-07
Size
10.5 KB
License
MIT
Applies to

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.