|
1 | 1 | // ==UserScript== |
2 | 2 | // @name YouTube™ Classic 📺 — (Remove rounded design + Return YouTube dislikes) |
3 | | -// @version 2026.1.17.25 |
| 3 | +// @version 2026.1.17.26 |
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 |
|
1793 | 1793 | } |
1794 | 1794 |
|
1795 | 1795 | function getDislikeTextContainer() { |
1796 | | - let result = |
1797 | | - getDislikeBtn().querySelector('#text') ?? |
1798 | | - getDislikeBtn().getElementsByTagName('yt-formatted-string')[0] ?? |
1799 | | - getDislikeBtn().querySelector('span[role="text"]') |
1800 | | - if (result == null) { |
1801 | | - let textSpan = document.createElement('span') |
1802 | | - textSpan.id = 'text' |
1803 | | - textSpan.style.marginLeft = '2px' |
1804 | | - getDislikeBtn().querySelector('button').appendChild(textSpan) |
1805 | | - getDislikeBtn().querySelector('button').style.width = 'auto' |
1806 | | - result = getDislikeBtn().querySelector('#text') |
| 1796 | + const dislikeBtn = getDislikeBtn() ; if (!dislikeBtn) return null |
| 1797 | + let result = dislikeBtn.querySelector('#text') |
| 1798 | + ?? dislikeBtn.getElementsByTagName('yt-formatted-string')[0] |
| 1799 | + ?? dislikeBtn.querySelector('span[role="text"]') |
| 1800 | + if (!result) { |
| 1801 | + const textSpan = document.createElement('span') |
| 1802 | + textSpan.id = 'text' ; textSpan.style.marginLeft = '2px' |
| 1803 | + dislikeBtn.querySelector('button').append(textSpan) |
| 1804 | + dislikeBtn.querySelector('button').style.width = 'auto' |
| 1805 | + result = dislikeBtn.querySelector('#text') |
1807 | 1806 | } |
1808 | 1807 | return result |
1809 | 1808 | } |
|
0 commit comments