|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2025.9.6 |
| 3 | +// @version 2025.9.23 |
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 |
|
84 | 84 | } |
85 | 85 | settings.load(Object.keys(settings.controls)) |
86 | 86 |
|
87 | | - // Init SELECTORS for optionos |
| 87 | + // Init SELECTORS for options |
88 | 88 | const configSelectors = { |
| 89 | + ads: { masthead: 'div#masthead-ad' }, // https://imgur.com/a/kOWzh3O |
89 | 90 | aiSummary: 'div#header[class*=expandable-metadata]:has(path[d*=M480-80q0-83]),' // AI summary |
90 | 91 | + 'button:has(path[d*=M480-80q0-83])' // Ask AI button |
91 | 92 | } |
|
282 | 283 | shortsObserver[config.disableShorts ? 'observe' : 'disconnect'](document.body, obsConfig) |
283 | 284 | else if (options?.updatedKey == 'adBlock') |
284 | 285 | adObserver[config.adBlock ? 'observe' : 'disconnect'](document.documentElement, obsConfig) |
285 | | - else if (options?.updatedKey == 'aiBlock') |
286 | | - window.configStyle.textContent = !config.aiBlock ? '' : `${configSelectors.aiSummary} { display: none }` |
| 286 | + if (options?.updatedKey.includes('Block')) |
| 287 | + window.configStyle.textContent = ` |
| 288 | + ${ !config.adBlock ? '' : `${configSelectors.ads.masthead} { display: none }`} |
| 289 | + ${ !config.aiBlock ? '' : `${configSelectors.aiSummary} { display: none }`}` |
287 | 290 | toolbarMenu.refresh() // prefixes/suffixes |
288 | 291 | } |
289 | 292 |
|
|
2223 | 2226 | }) |
2224 | 2227 | if (config.adBlock) getLoadedElem('html').then(() => adObserver.observe(document.documentElement, obsConfig)) |
2225 | 2228 |
|
2226 | | - // Block AI |
| 2229 | + // Block stuff |
2227 | 2230 | document.head.append(window.configStyle ??= document.createElement('style')) |
2228 | | - window.configStyle.textContent = !config.aiBlock ? '' : `${configSelectors.aiSummary} { display: none }` |
| 2231 | + window.configStyle.textContent = ` |
| 2232 | + ${ !config.adBlock ? '' : `${configSelectors.ads.masthead} { display: none }`} |
| 2233 | + ${ !config.aiBlock ? '' : `${configSelectors.aiSummary} { display: none }`}` |
2229 | 2234 |
|
2230 | 2235 | })() |
0 commit comments