|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2026.1.17.44 |
| 3 | +// @version 2026.1.17.45 |
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 |
|
604 | 604 | } catch (err) {} |
605 | 605 | return thread |
606 | 606 | } |
607 | | - function refreshData(element) { |
608 | | - const clone = element.cloneNode() |
609 | | - clone.data = element.data |
| 607 | + function refreshData(elem) { |
| 608 | + const clone = elem.cloneNode() |
| 609 | + clone.data = elem.data |
610 | 610 | clone.data.fixedByCF = true |
611 | | - for (const i in element.properties) clone[i] = element[i] |
612 | | - element.insertAdjacentElement('afterend', clone) |
613 | | - element.remove() |
| 611 | + for (const i in elem.properties) clone[i] = elem[i] |
| 612 | + elem.insertAdjacentElement('afterend', clone) |
| 613 | + elem.remove() |
614 | 614 | } |
615 | 615 | const commentObserver = new MutationObserver(mutations => mutations.forEach(async mutation => { |
616 | 616 | if (mutation.addedNodes) for (const elem of mutation.addedNodes) if (elem.classList && !elem.data?.fixedByCF) |
|
1217 | 1217 | console.log(`[Return YouTube Dislikes] ${text} ${subtext}`) |
1218 | 1218 | } |
1219 | 1219 |
|
1220 | | - function isInViewport(element) { |
1221 | | - const rect = element.getBoundingClientRect() |
| 1220 | + function isInViewport(elem) { |
| 1221 | + const rect = elem.getBoundingClientRect() |
1222 | 1222 | const height = innerHeight || document.documentElement.clientHeight |
1223 | 1223 | const width = innerWidth || document.documentElement.clientWidth |
1224 | 1224 | return ( |
1225 | | - // When short (channel) is ignored, the element (like/dislike AND short itself) is |
| 1225 | + // When short (channel) is ignored, the elem (like/dislike AND short itself) is |
1226 | 1226 | // hidden with a 0 DOMRect. In this case, consider it outside of Viewport |
1227 | 1227 | !(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) && |
1228 | 1228 | rect.top >= 0 && |
|
0 commit comments