Skip to content

About

A high-performance, lightweight Chrome Extension (Manifest V3) engineered to eliminate endless doomscrolling on YouTube Shorts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Scroll Killer Logo

Scroll Killer — YouTube Shorts Scroll Blocker

Manifest V3 JavaScript CSS3 YouTube License: MIT

A high-performance, lightweight Chrome Extension (Manifest V3) engineered to eliminate endless doomscrolling on YouTube Shorts. By locking vertical scroll navigation, suppressing on-screen navigation arrows, and enforcing single-video focus, Scroll Killer helps users maintain intentional viewing habits.


Scroll Killer UI Preview


🎯 Key Features

  • Vertical Scroll Prevention: Intercepts and blocks vertical navigation triggered by mouse wheel scrolling, touch swipe gestures, and keyboard navigation keys (ArrowUp, ArrowDown, PageUp, PageDown, Space).
  • On-Screen Arrow Suppression: Dynamically hides and removes YouTube's up and down navigation buttons.
  • Master & Fine-Grained Controls: Toggle total protection ON/OFF instantly, or independently configure rules for Wheel/Swipe, Keyboard Keys, and Navigation Buttons.
  • Active Video Context Detection: Automatically detects and displays the active Short title and channel name in the extension popup.
  • Protection Metrics: Tracks blocked scroll attempts in real-time with an optimized, IPC-buffered local counter.
  • Global Keyboard Shortcut: Toggle protection instantly using Alt + S (Option + S on macOS) anywhere across YouTube.
  • Dual-Theme Design System: Seamlessly switch between Day (Light) and Night (Dark) themes with persistent state sync.
  • Privacy & Security: 100% local execution—zero background tracking, analytics, or external API calls.

🏗️ Architecture & Technical Highlights

Scroll Killer is architected following modern Chrome Extension Manifest V3 best practices:

┌────────────────────────────────────────────────────────────────────────┐
│                          Scroll Killer Extension                       │
└────────────────────────────────────────────────────────────────────────┘
            │                                         │
            ▼                                         ▼
┌──────────────────────┐                  ┌──────────────────────┐
│ Background Worker    │ ◄── Storage ───► │ Popup Controller     │
│ (background.js)      │     Sync         │ (popup.js/css/html)  │
└──────────┬───────────┘                  └──────────────────────┘
           │
           │ Chrome Runtime IPC Messages
           ▼
┌──────────────────────┐
│ Content Script       │ ──► Enforces CSS Lock & Event Listeners
│ (content.js)         │ ──► MutationObserver & SPA Lifecycle Listeners
└──────────────────────┘ ──► Local Metric Buffer & Periodic Flush

Performance & Optimization Engineering

  1. Event-Driven DOM Monitoring: Replaces interval polling loops with a debounced MutationObserver combined with YouTube SPA lifecycle events (yt-navigate-finish, yt-page-data-updated, popstate).
  2. Zero-GC Keydown Interception: Uses a pre-allocated Set (BLOCK_SCROLL_KEYS) for $O(1)$ key validation, preventing memory allocations and garbage collection pauses during key events.
  3. Idempotent CSS Locking: Injects lock styles conditionally based on state hashing, eliminating browser style recalculations and layout thrashing.
  4. Buffered Metric IPC: Local scroll block attempts are buffered in memory and flushed to background storage in batches every 3 seconds or on tab unload, reducing extension IPC messaging overhead by over 95%.
  5. Hardware-Accelerated UI: The popup UI leverages CSS custom properties and hardware-accelerated animations (will-change, transform: translateZ(0)) for smooth 60 FPS transitions.

📁 Project Structure

Scroll-Killer/
├── manifest.json         # Manifest V3 extension configuration & permissions
├── background.js        # Background service worker (state, badge, shortcut dispatcher)
├── content.js           # YouTube content script (scroll locking, DOM observer, SPA hooks)
├── popup.html           # Accessible popup markup (ARIA roles, semantic layout)
├── popup.js             # Encapsulated popup state controller & theme manager
├── popup.css            # Dual-theme design system (Light/Dark mode tokens & GPU transitions)
├── generate-icons.js    # Node.js binary builder script for PNG icons
├── icons/               # Extension toolbar icons (16x16, 32x32, 48x48, 128x128)
│   ├── icon16.png
│   ├── icon32.png
│   ├── icon48.png
│   └── icon128.png
└── README.md            # Technical documentation & usage guide

⚙️ Configuration & Storage Schema

The extension persists user preferences in chrome.storage.local using the following schema:

{
  "enabled": true,
  "blockWheel": true,
  "blockKeys": true,
  "hideNavButtons": true,
  "blockedCount": 0,
  "theme": "light"
}

Keyboard Shortcut Configuration

  • Default Shortcut: Alt + S (Windows/Linux) / Option + S (macOS).
  • Customization: Click the Change button in the popup settings or navigate to chrome://extensions/shortcuts to rebind the shortcut.

📥 Installation & Setup

Prerequisites

  • Google Chrome, Brave, Microsoft Edge, or any Chromium-based browser supporting Manifest V3.
  • (Optional) Node.js v14+ if rebuilding icons via generate-icons.js.

Loading Unpacked Extension

  1. Clone or download this repository to your local machine:
    git clone https://github.com/Yavagu/Scroll-Killer.git
  2. Open Chrome and navigate to:
    chrome://extensions/
    
  3. Enable Developer mode in the top-right toggle switch.
  4. Click Load unpacked in the top-left toolbar.
  5. Select the Scroll-Killer directory.
  6. Pin Scroll Killer to your Chrome extension toolbar.

🛠️ Scripts & Utilities

Icon Binary Generator (generate-icons.js)

Scroll Killer includes a zero-dependency Node.js script that constructs standard PNG binaries (using native fs, path, and zlib modules) for all extension icon dimensions:

node generate-icons.js

Output: Generates icon16.png, icon32.png, icon48.png, and icon128.png in the icons/ directory.


📄 License

This project is open-source software. Licensed under the MIT License.

About

A high-performance, lightweight Chrome Extension (Manifest V3) engineered to eliminate endless doomscrolling on YouTube Shorts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages