|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2025.10.18 |
| 3 | +// @version 2025.10.18.1 |
4 | 4 | // @author Adam Lui, Magma_Craft, Anarios, JRWR, Fuim & hoothin |
5 | 5 | // @namespace https://github.com/adamlui |
6 | 6 | // @description Reverts YouTube to its classic design (before all the rounded corners & hidden dislikes) + redirects YouTube Shorts |
|
54 | 54 | helptip: 'Redirect Shorts to classic wide player' }, |
55 | 55 | shortsBlock: { type: 'toggle', label: 'Hide Shorts', defaultVal: true, |
56 | 56 | helptip: 'Hide Shorts from appearing in home page + results' }, |
| 57 | + playablesBlock: { type: 'toggle', label: 'Hide Playables', defaultVal: true, |
| 58 | + helptip: 'Hide Playables from appearing in home page' }, |
57 | 59 | adBlock: { type: 'toggle', label: 'Block Ads', defaultVal: false, |
58 | 60 | helptip: 'Hide ad thumbnails from homepage layouts' }, |
59 | 61 | aiBlock: { type: 'toggle', label: 'Block AI Summaries', defaultVal: true, |
|
294 | 296 | homeObserver[config.adBlock ? 'observe' : 'disconnect'](document.documentElement, obsConfig) |
295 | 297 | if (options?.updatedKey.includes('Block')) |
296 | 298 | window.configStyle.textContent = ` |
297 | | - ${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }`} |
298 | | - ${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }`} |
299 | | - ${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }`}` |
| 299 | + ${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }` } |
| 300 | + ${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }` } |
| 301 | + ${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }` }` |
300 | 302 | toolbarMenu.refresh() // prefixes/suffixes |
301 | 303 | } |
302 | 304 |
|
|
2227 | 2229 | } else if (locationPath == '/') { // remove homepage stuff |
2228 | 2230 | const adSlot = document.querySelector('ytd-ad-slot-renderer') |
2229 | 2231 | const richSection = document.querySelector( |
2230 | | - `ytd-rich-section-renderer${ !config.shortsBlock ? ':not(:has(a[href*="/shorts/"]))' : '' }`) |
| 2232 | + `ytd-rich-section-renderer${ !config.shortsBlock ? ':not(:has(a[href*="/shorts/"]))' : '' }${ |
| 2233 | + !config.playablesBlock ? ':not(:has(a[href*="/playables/"]))' : '' }` |
| 2234 | + ) |
2231 | 2235 | adSlot?.closest('[rendered-from-rich-grid]')?.remove() ; richSection?.remove() |
2232 | 2236 | } |
2233 | 2237 | }) |
2234 | | - if (config.shortsBlock || config.adBlock) |
| 2238 | + if (config.shortsBlock || config.playablesBlock || config.adBlock) |
2235 | 2239 | getLoadedElem('html').then(() => homeObserver.observe(document.documentElement, obsConfig)) |
2236 | 2240 |
|
2237 | 2241 | // Block stuff |
2238 | 2242 | document.head.append(window.configStyle ??= document.createElement('style')) |
2239 | 2243 | window.configStyle.textContent = ` |
2240 | | - ${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }`} |
2241 | | - ${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }`} |
2242 | | - ${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }`}` |
| 2244 | + ${ !config.shortsBlock ? '' : `${extractSelectors(domSelectors.shorts).join(',')} { display: none }` } |
| 2245 | + ${ !config.adBlock ? '' : `${extractSelectors(domSelectors.ads).join(',')} { display: none }` } |
| 2246 | + ${ !config.aiBlock ? '' : `${domSelectors.aiSummary} { display: none }` }` |
2243 | 2247 | function extractSelectors(obj) { |
2244 | 2248 | return Object.values(obj).flatMap(val => typeof val == 'object' ? extractSelectors(val) : val) } |
2245 | 2249 |
|
|
0 commit comments