Adds keyboard shortcuts [ and ] for liking and disliking videos, and s for skipping pre-video and banner ads.
< Părere la script-ul Youtube like/dislike video and skip ad keyboard shortcuts
s
works correctly, however [
and ]
are intercepted by Iridium.Oops, my bad. I assumed Iridium was intercepting key events, but actually it just happens to insert buttons right where this script looks for them (in ytd-video-primary-info-renderer
).
To get around this, this script just has to be a little more specific. I have edited mine to look for ytd-menu-renderer
inside of ytd-video-primary-info-renderer
:
videoinfo = document.getElementsByTagName("ytd-video-primary-info-renderer");
videoinfo = (videoinfo.length == 1) ? videoinfo[0].getElementsByTagName("ytd-menu-renderer") : [];
Not the cleanest solution, but it works as a one line fix that means I don't end up re-writing half the script.
Feature requests
1) "Add to WatchLater list" shortcut 2) compatibility with https://github.com/ParticleCore/Iridium (YouTube+) script 3) publish it on github.com or bitbucket.org for better track of versions and possibility of pull requests