feat: add Return YouTube Dislike support and adjust UI option box layout - #477
Open
WesamAbadi wants to merge 1 commit into
Open
feat: add Return YouTube Dislike support and adjust UI option box layout#477WesamAbadi wants to merge 1 commit into
WesamAbadi wants to merge 1 commit into
Conversation
fire332
requested changes
Aug 2, 2026
Collaborator
There was a problem hiding this comment.
Why were these values changed?
| return cache.get(videoID) || null; | ||
| } | ||
|
|
||
| try { |
Collaborator
There was a problem hiding this comment.
Scope the try-catch to only the fetch unless you expect the JSON parse to fail.
| } | ||
| } else { | ||
| formattedString = document.createElement('yt-formatted-string'); | ||
| formattedString.className = 'XGffTd OqGroe ytaf-ryd-native-label'; |
Collaborator
There was a problem hiding this comment.
Hard coding obfuscated CSS classes seems fragile. What alternatives have you considered before you settled on this?
| return configRead('enableReturnYouTubeDislike'); | ||
| } | ||
|
|
||
| function formatCount(num: number): string { |
Collaborator
There was a problem hiding this comment.
Add the @formatjs/intl-numberformat polyfill and use:
const preferredLang // from YouTube's pref cookie
new Intl.NumberFormat(preferredLang, {
notation: "compact",
compactDisplay: "short",
}).format()| const total = likes + dislikes; | ||
| if (total === 0) return '100%'; | ||
| const percentage = Math.round((likes / total) * 100); | ||
| return `${percentage}%`; |
Collaborator
There was a problem hiding this comment.
Use Intl.NumberFormat here as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add RYD support