|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2026.1.21.12 |
| 3 | +// @version 2026.1.21.13 |
4 | 4 | // @author Adam Lui, Magma_Craft, 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 |
|
15 | 15 | // @match *://*.youtube.com/* |
16 | 16 | // @connect gm.ytclassic.com |
17 | 17 | // @connect raw.githubusercontent.com |
| 18 | +// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@6412760/assets/js/lib/css.js/dist/css.min.js#sha256-NPFbv/zlZBXfPJAMHFAkqB7wIGT/faDwz1RH4ZEshd0= |
18 | 19 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@3683a79/assets/js/lib/dom.js/dist/dom.min.js#sha256-Xl5ghi373aMe12nN4vOKB+C5IJQY43AtjVAdB0K3Dag= |
19 | 20 | // @require https://cdn.jsdelivr.net/gh/Anarios/return-youtube-dislike@c0c3a2e/Extensions/UserScript/Return%20Youtube%20Dislike.user.js#sha256-BPRgJOQfxTUmr09fqGi1dlZ14jtZfdKHhKltqmf5B+Y= |
20 | 21 | // @grant GM_registerMenuCommand |
|
289 | 290 | return notificationDiv |
290 | 291 | } |
291 | 292 |
|
292 | | - function extractSelectors(obj) { |
293 | | - return Object.values(obj).flatMap(val => typeof val == 'object' ? extractSelectors(val) : val) } |
294 | | - |
295 | 293 | const toolbarMenu = { |
296 | 294 | state: { |
297 | 295 | symbols: ['❌', '✔️'], separator: env.scriptManager.name == 'Tampermonkey' ? ' — ' : ': ', |
|
352 | 350 | } else if (options?.updatedKey.includes('Block')) |
353 | 351 | window.configStyle.textContent = Object.entries(domSelectors) |
354 | 352 | .map(([key, selectors]) => !config[`${key}Block`] ? '' |
355 | | - : `${extractSelectors(selectors).join(',')} { display: none }` |
| 353 | + : `${css.selectors.extract(selectors).join(',')} { display: none }` |
356 | 354 | ).join('') |
357 | 355 | toolbarMenu.refresh() // prefixes/suffixes |
358 | 356 | } |
|
1151 | 1149 | // Block stuff |
1152 | 1150 | document.head.append(window.configStyle ??= dom.create.style()) |
1153 | 1151 | window.configStyle.textContent = Object.entries(domSelectors).map(([key, selectors]) => |
1154 | | - !config[`${key}Block`] ? '' : `${extractSelectors(selectors).join(',')} { display: none }`).join('') |
| 1152 | + !config[`${key}Block`] ? '' : `${css.selectors.extract(selectors).join(',')} { display: none }`).join('') |
1155 | 1153 | })() |
0 commit comments