Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shortkiller

A Chrome extension that removes YouTube Shorts from the browsing experience and redirects any Shorts player URL to the normal watch player. Built to protect kids (or yourself) from the Shorts doom-scroll.

What it does

  • Redirects the Shorts player. Any navigation to youtube.com/shorts/<id> (direct link, bookmark, or in-app click) is rewritten to the normal youtube.com/watch?v=<id> player before the swipe-feed can load. Uses location.replace, so the Back button can't return to a Shorts URL.
  • Hides every Shorts surface, including:
    • Shorts shelves on Home and Subscriptions
    • Shorts shelves / cards in search results and the watch-page related column
    • The "Shorts" entry in the sidebar and mini-guide
    • The "Shorts" tab on channel pages
    • Shorts entries in the notifications menu
    • The Shorts button in the mobile web pivot bar
  • Never breaks other content. Community posts, news shelves, and all long-form video shelves are deliberately left untouched — only elements whose own thumbnail/link points at a Shorts video are hidden.
  • One on/off toggle, synced via chrome.storage.sync. Default is on (Shorts blocked). Turning it off restores Shorts everywhere, live, with no page reload required.

Hiding is done primarily through CSS (src/shortkiller.css), injected at document_start so there's no flash of Shorts content before it applies. A small JS layer (src/hide.js) handles the few cases CSS selectors can't express (text-matched nav labels) plus a debounced safety-net rescan. src/redirect.js is the highest-priority layer and runs first.

Install

Chrome does not allow extensions from outside the Chrome Web Store to install with a single click — loading an unpacked extension always requires Developer mode + Load unpacked, on purpose (it's an anti-malware guardrail). Pick whichever of these gets you there fastest.

Option A — Download from GitHub, load unpacked (recommended)

  1. Click the green Code button on this repo → Download ZIP (or git clone this repo if you're comfortable with git).
  2. Extract the ZIP anywhere on your computer.
  3. Open chrome://extensions in Chrome.
  4. Turn on Developer mode (top-right toggle).
  5. Click Load unpacked and select the extracted folder (the one containing manifest.json).
  6. The Shortkiller icon appears in the toolbar. Shorts are blocked immediately on any open or new YouTube tab.

To get updates later: git pull (or re-download the ZIP), then click the refresh icon on the Shortkiller card at chrome://extensions.

Option B — Guided installer (easiest for non-technical family members)

  1. Download dist/shortkiller-installer-v1.0.0.zip (click it, then the Download raw file button) and extract it.
  2. Double-click INSTALL.bat.
  3. It copies the extension to %LOCALAPPDATA%\Shortkiller, copies that path to your clipboard, and opens chrome://extensions for you.
  4. Turn on Developer mode, click Load unpacked, and paste the path from your clipboard.

See installer/README.txt for details and uninstall instructions.

Option C — Chrome Web Store

If a Web Store listing exists for this extension, that link is the true one-click install (no Developer mode needed) — check the top of this README or the repo description for the link.

Using the toggle

Click the toolbar icon to open the popup:

  • The switch shows the current state and the status line reads either "Shorts are blocked" or "Shorts are visible".
  • Flipping the switch updates chrome.storage.sync immediately; every open YouTube tab picks up the change within about a second, with no reload.
  • The setting persists across browser restarts and (if Chrome sync is enabled) across signed-in devices.

Permissions

Only storage is requested — no tabs, no scripting, no host permissions beyond the two content-script matches (www.youtube.com and m.youtube.com). The extension cannot read or affect any other site.

A note on YouTube UI changes

YouTube periodically renames or restructures its internal components (custom element tags, view-model names, class names). When that happens, some Shorts surfaces may reappear until selectors are updated. The design is layered so a single missed renderer rarely matters:

  • Item-level :has(a[href^="/shorts/"]) rules in src/shortkiller.css catch most new components automatically, since they key off the link rather than the component name.
  • The JS safety net in src/hide.js (scanAndHide / section B3) sweeps any /shorts/ thumbnail link that slipped past the CSS list.
  • Even if hiding fails entirely, src/redirect.js still prevents the Shorts swipe player from ever loading — clicking a visible Short still lands on the normal watch page.

If you need to add a selector for a new YouTube component, prefer adding a new scoped rule (anchored to a specific renderer tag) over broadening an existing one, and keep the /shorts/ (trailing slash, video path) vs. /shorts (feed root, used in nav) distinction intact — see docs/DESIGN.md for the full rationale and selector inventory.

File layout

Shortkiller/
├── manifest.json
├── src/
│   ├── redirect.js        # runs at document_start: /shorts/ → /watch
│   ├── hide.js             # toggle wiring, MutationObserver, text-match fallback
│   └── shortkiller.css     # all hiding rules
├── popup/
│   ├── popup.html
│   ├── popup.js
│   └── popup.css
├── icons/
│   ├── icon16.png
│   ├── icon48.png
│   └── icon128.png
├── docs/
│   └── DESIGN.md            # full technical design spec
├── installer/
│   ├── INSTALL.bat          # guided installer for non-technical users
│   └── README.txt
└── README.md

Contributing

Selector breakage from YouTube UI changes is the main maintenance need. If Shorts start slipping through:

  1. Open YouTube DevTools, find the new element/attribute wrapping the Shorts card that's leaking through.
  2. Add a new scoped rule to src/shortkiller.css (prefer adding a rule over broadening an existing one — see docs/DESIGN.md §11 for why false positives are the bigger risk).
  3. Test against the Acceptance Checklist in the design doc before opening a PR.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages