Remove Twitch AutoPlay

Removes the annoying auto-playing stream that takes up half the screen in a category

Autor
Ryder7223
Denně instalací
0
Celkem instalací
5
Hodnocení
0 0 0
Verze
1.2
Vytvořeno
02. 04. 2025
Aktualizováno
02. 04. 2025
Size
1,0 KB
Licence
CC BY-ND 4.0; You may use this script but not modify or distribute modified versions.
Spustit na

Remove Twitch Short

Overview

This userscript removes the annoying auto-playing stream that takes up a large portion of the screen in Twitch category pages. It works by detecting and removing the intrusive element as soon as it appears.

Features

  • Automatically removes the auto-playing stream in Twitch category pages.
  • Works dynamically with MutationObserver, ensuring the element is deleted even if loaded later.
  • Lightweight and efficient, stops observing after 30 seconds to prevent unnecessary performance impact.

Installation

  1. Install Tampermonkey (or a compatible userscript manager).
  2. Click here to install
  3. Enjoy a cleaner Twitch browsing experience!

Supported URLs

Technical Details

This script uses:

  • querySelectorAll to find and remove the targeted element.
  • MutationObserver to detect and remove dynamically loaded elements.
  • A 30-second timeout to prevent infinite observation.

Source Code

(function() {
  'use strict';

  function removeElements() {
    const els = document.querySelectorAll('div.Layout-sc-1xcs6mc-0.kyIYma');
    els.forEach(el => el.remove());
  }

  // Run once in case the element is already loaded
  removeElements();

  // Create a MutationObserver to watch for dynamically loaded elements
  const observer = new MutationObserver(() => removeElements());

  observer.observe(document.body, { childList: true, subtree: true });

  // Stop observing after a while (optional, to prevent infinite observation)
  setTimeout(() => observer.disconnect(), 30 * 1000); // Stops after 30 seconds
})();
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元