|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2026.1.17.22 |
| 3 | +// @version 2026.1.17.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 |
|
1775 | 1775 | return document.getElementById('menu-container')?.querySelector('#top-level-buttons-computed') |
1776 | 1776 | } |
1777 | 1777 |
|
1778 | | - function getLikeButton() { |
1779 | | - return getBtns().children[0].tagName == |
1780 | | - 'YTD-SEGMENTED-LIKE-DISLIKE-BUTTON-RENDERER' |
1781 | | - ? getBtns().children[0].children[0] |
1782 | | - : getBtns().children[0] |
| 1778 | + function getLikeBtn() { |
| 1779 | + let firstBtn = getBtns().children[0] |
| 1780 | + return firstBtn.tagName == 'YTD-SEGMENTED-LIKE-DISLIKE-BUTTON-RENDERER' ? firstBtn.children[0] : firstBtn |
1783 | 1781 | } |
1784 | 1782 |
|
1785 | 1783 | function getLikeTextContainer() { |
1786 | 1784 | return ( |
1787 | | - getLikeButton().querySelector('#text') ?? |
1788 | | - getLikeButton().getElementsByTagName('yt-formatted-string')[0] ?? |
1789 | | - getLikeButton().querySelector('span[role="text"]') |
| 1785 | + getLikeBtn().querySelector('#text') ?? |
| 1786 | + getLikeBtn().getElementsByTagName('yt-formatted-string')[0] ?? |
| 1787 | + getLikeBtn().querySelector('span[role="text"]') |
1790 | 1788 | ) |
1791 | 1789 | } |
1792 | 1790 |
|
|
1867 | 1865 | function getLikeCountFromButton() { |
1868 | 1866 | try { |
1869 | 1867 | if (isShorts()) return null |
1870 | | - const likeBtn = getLikeButton().querySelector('yt-formatted-string#text') |
1871 | | - ?? getLikeButton().querySelector('button') |
| 1868 | + const likeBtn = getLikeBtn().querySelector('yt-formatted-string#text') |
| 1869 | + ?? getLikeBtn().querySelector('button') |
1872 | 1870 | const likesStr = likeBtn.getAttribute('aria-label').replace(/\D/g, '') |
1873 | 1871 | return likesStr.length ? parseInt(likesStr) : null |
1874 | 1872 | } |
|
1971 | 1969 | if (extConfig.coloredThumbs) { |
1972 | 1970 | if (isShorts()) { |
1973 | 1971 | // for shorts, leave deactived buttons in default color |
1974 | | - let shortLikeButton = getLikeButton().querySelector( |
| 1972 | + let shortLikeButton = getLikeBtn().querySelector( |
1975 | 1973 | 'tp-yt-paper-button#button' |
1976 | 1974 | ) |
1977 | 1975 | let shortDislikeButton = getDislikeButton().querySelector( |
|
1992 | 1990 | mutationObserver.options |
1993 | 1991 | ) |
1994 | 1992 | } else { |
1995 | | - getLikeButton().style.color = getColorFromTheme(true) |
| 1993 | + getLikeBtn().style.color = getColorFromTheme(true) |
1996 | 1994 | getDislikeButton().style.color = getColorFromTheme(false) |
1997 | 1995 | } |
1998 | 1996 | } |
|
0 commit comments