pietervanheijningen / clickbait-remover-for-youtube

Replaces thumbnails and modifies titles of videos on youtube.com
https://chrome.google.com/webstore/detail/clickbait-remover-for-you/omoinegiohhgbikclijaniebjpkeopip
MIT License
354 stars 21 forks source link

Add quality setting choice #64

Open Zegnat opened 5 months ago

Zegnat commented 5 months ago

This is just a rough pass over a patch I want. Opening a PR to share.

Basically anywhere the code has preferred_thumbnail_file there is now an additional preferred_thumbnail_resolution. The available resolutions are all the ones I know of: 90p, 180p, 360p, 480p, and 720p. The previous default of hq is only the 360p screenshot, which on my display for the YouTube homepage looks terrible.

Most of the work actually went into getting the onChanged handler for the settings to work well. I want to have another pass at optimising this before I would consider this PR ready for merge. I would then also want to make youtube.js support more than 1 settings change. It currently only has one possible cache killer. This made testing a little annoying.

Another thing that made testing annoying was that the firefox_manifest.json did not work for me at all. I had to add declarativeNetRequest to get anywhere with it. I need to take another pass at that one to get the extension to actually start running its latest code in Firefox again.

@pietervanheijningen would you be interested in merging a PR introducing the quality picker as well as getting Firefox updated to run version 9 of the extension? Or am I better off maintaining a fork for myself and AMO?

pietervanheijningen commented 5 months ago

Hey Thanks for the PR! Sorry for the late reply, been busy.

Didn't notice the thumbnail quality being low! Good catch! Personally I like to keep the extension as simple as possible, so people don't have to mess about with settings. So maybe making the thumbnail selection automatic based on screen resolution could be nice? So like everything 4K resolution and above would get 720p thumbnails for example, personally can't see why people would want higher resolution thumbnails for any other reason.

Another thing that made testing annoying was that the firefox_manifest.json did not work for me at all

Yup, the firefox version is kind of outdated at the moment, it's still running on manifest v2, as some feature that I was using is incompatiable with firefox's implementation of manifest v3. Don't remember with one exactly though - Anyway, yes the repository code doesn't work with firefox at the moment, should have maybe left a note somewhere.