Skip to content

feat: add Return YouTube Dislike support and adjust UI option box layout - #477

Open
WesamAbadi wants to merge 1 commit into
webosbrew:mainfrom
WesamAbadi:main
Open

feat: add Return YouTube Dislike support and adjust UI option box layout#477
WesamAbadi wants to merge 1 commit into
webosbrew:mainfrom
WesamAbadi:main

Conversation

@WesamAbadi

Copy link
Copy Markdown

add RYD support

@fire332 fire332 added the enhancement New feature or request label Aug 2, 2026
Comment thread src/ui.css

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these values changed?

Comment thread src/return-dislikes.ts
return cache.get(videoID) || null;
}

try {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope the try-catch to only the fetch unless you expect the JSON parse to fail.

Comment thread src/return-dislikes.ts
}
} else {
formattedString = document.createElement('yt-formatted-string');
formattedString.className = 'XGffTd OqGroe ytaf-ryd-native-label';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard coding obfuscated CSS classes seems fragile. What alternatives have you considered before you settled on this?

Comment thread src/return-dislikes.ts
return configRead('enableReturnYouTubeDislike');
}

function formatCount(num: number): string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the @formatjs/intl-numberformat polyfill and use:

const preferredLang // from YouTube's pref cookie
new Intl.NumberFormat(preferredLang, {
  notation: "compact",
  compactDisplay: "short",
}).format()

Comment thread src/return-dislikes.ts
const total = likes + dislikes;
if (total === 0) return '100%';
const percentage = Math.round((likes / total) * 100);
return `${percentage}%`;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Intl.NumberFormat here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants