Skip to content

pravinbashyal/short-blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

YouTube Shorts Blocker

A browser extension that automatically removes YouTube Shorts elements (ytm-shorts-lockup-view-model-v2) from YouTube pages.

Features

  • Automatically removes YouTube Shorts elements from all YouTube pages
  • Continuously monitors for dynamically loaded content
  • Works on both desktop and mobile versions of YouTube
  • Lightweight and efficient

Installation

Chrome/Edge/Brave

  1. Open your browser and navigate to chrome://extensions/
  2. Enable "Developer mode" in the top right corner
  3. Click "Load unpacked"
  4. Select the folder containing this extension
  5. The extension is now installed and active!

Firefox

  1. Open Firefox and navigate to about:debugging#/runtime/this-firefox
  2. Click "Load Temporary Add-on"
  3. Navigate to the extension folder and select the manifest.json file
  4. The extension is now installed and active!

How It Works

The extension uses a content script that:

  • Runs on all YouTube pages (*.youtube.com)
  • Searches for elements with the tag ytm-shorts-lockup-view-model-v2 and elements with the is-shorts attribute
  • Removes these elements from the page
  • Monitors for new elements being added dynamically using MutationObserver
  • Runs a periodic check every second as a fallback

Files

  • manifest.json - Extension configuration file
  • content.js - Main content script that removes Shorts elements
  • README.md - This file

Optional: Adding Custom Icons

If you'd like to add custom icons for the extension:

  1. Create PNG images named icon16.png, icon48.png, and icon128.png (16x16, 48x48, and 128x128 pixels)
  2. Place them in the extension folder
  3. Add this to the manifest.json file after the content_scripts section:
  "icons": {
    "16": "icon16.png",
    "48": "icon48.png",
    "128": "icon128.png"
  }

Notes

  • The extension requires no special permissions
  • It only runs on YouTube domains
  • You can view console logs in the browser's Developer Tools to see when elements are removed

Troubleshooting

If the extension isn't working:

  1. Make sure it's enabled in your browser's extension settings
  2. Try refreshing the YouTube page
  3. Check the browser console for any error messages
  4. Verify you're on a YouTube page (the extension only works on *.youtube.com)

Privacy

This extension runs entirely locally in your browser and does not collect, store, or transmit any data.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors