Add an indicator for watched videos on YouTube. Use GM menus to display history statistics, backup history, and restore/merge history.
< Feedback on Mark Watched YouTube Videos
Updated. Thanks for the report.
Thanks for the quick update. Unfortunately v1.4.65 doesn't work for me (for YT suggestions on the right side).
In v1.4.64, you added selector .ytd-item-section-renderer
, which might have been overzealous. Did you try yt-lockup-view-model.ytd-item-section-renderer
? This one has a length
of 20 items, which corresponds to the 20 suggested videos to the right, when loading any YT video. Its length increases by 20 when scrolling down and YT fetches (20) more video suggestions. So, this selector seems to match suggested videos specifically. I tested this with ##yt-lockup-view-model.ytd-item-section-renderer
in ublock origin on several sections within YT, and didn't notice any false matches.
Looking at your newest v1.4.65, selector ytd-watch-next-secondary-results-renderer>.ytd-watch-next-secondary-results-renderer>.ytd-watch-next-secondary-results-renderer
matches 2 results and triggers the for loop in processVideoItems
. I looked at link
and querySelector.call(items[i], "A"))
inside the if (link = querySelector.call(items[i], "A"))
, and this if statement only ever matches when link
and querySelector.call(items[i], "A"))
are both empty
? (It works fine on the YT main page though)
I tried selecting the whole sidebar of suggested videos with a different selector (that works in ublock origin) .ytd-watch-next-secondary-results-renderer > ytd-item-section-renderer > .ytd-item-section-renderer
, but that one also ends up with only empty
matches in processVideoItems
.
Geez... YouTube kept flipping between old and new layout back and forth. This v1.4.66 update is for this time of changes only. If YouTube stil kept flipping or making changes, I'll have to postpone script update and let it settle down, before catching up.
Oof, sorry, I hadn't considered YT shenanigans. Maybe they are a/b testing too. Big Tech doing its thing ... enshitification!
Thanks for updating the script.
Very useful script that's working well. Only the videos in the sidebar to the right (inside div#related) are not marked any more (07.2025). I don't know which of the processVideoItems fails ... because it doesn't exist any more after YT changed it. But adding "processVideoItems(`{{{{linebreak}}}}yt-lockup-view-model.ytd-item-section-renderer`);" captures the sidebar videos too.