YouTube Keyboard Shortcuts: like/dislike, backup/restore position, change speed, picture-in-picture…

Adds keyboard shortcuts [ and ] for liking and disliking videos, B and R to Back up and Restore position, H to use picture-in-picture, { and } to change playback speed.

These are versions of this script where the code was updated. Show all versions.

  • v1.18 2024-07-09

    version 1.18: fixed like/dislike button detection after YouTube changed them once again

  • v1.17 2024-01-07

    version 1.17: Added u to "undo" a jump. If you were playing the video and pressed 5 to jump to 50% of the video, you can press u to go back to where you were. There's only one level of "undo", and pressing u again doesn't jump back to 50%. Also fixed the like/dislike shortcuts on some videos where the dislike button says "Disabled by owner".

  • v1.16 2023-07-31

    version 1.16: fixed like/dislike button lookup (again!) after YouTube changed their HTML once more. It should work on both regular videos and shorts too, now.

  • v1.15 2023-03-12

    version 1.15: Better handling of repeated key presses, there's now a timer to avoid super-fast repeats for people who have their keyboard repeat settings set to max (typically on Windows). This should make controls easier. Also updated the logic for Shorts after noticing that like/dislike did not always work, this was possibly because of changes in the page structure made by YouTube. Plus some minor code cleanup.

  • v1.14 2023-02-22

    version 1.14: I'm changing the +1/-1 and +5/-5 keys after realizing that o is already used by the YouTube player itself, to change the opacity of subtitles. Z and X don't seem to be used, so I changed the script to use Z for -5s and X for +5s, or -1s/+1s if used with Shift. Hopefully they won't conflict with anything this time. I would have preferred to use A and S, but these are used for spherical videos…

  • v1.13 2023-02-21

    version 1.13: re-enable alt+o and alt+p after bugfix

  • v1.12 2023-02-21

    version 1.12: fix bug introduced in yesterday's release, the script was intercepting important shortcuts by accident. This is no longer the case, my apologies if you encountered this issue :-/

  • v1.11 2023-02-21

    version 1.11: added alt + o to go back 1 second, and alt + p to skip ahead by 1 second. I thought of using shift instead of alt, but this doesn't work since shift + p is already "go to previous video in playlist" on YouTube. ctrl wouldn't work either, since ctrl + p is "print page" on Windows, so alt it is.

  • v1.10 2023-01-31

    version 1.10: YouTube has recently made some design changes to the "Shorts" viewer, which broke the "like"/"dislike" keyboard shortcuts since the buttons couldn't be found any more. These shortcuts should work again now! No other shortcuts were affected.

  • v1.9 2023-01-15

    version 1.9: fixed bug with chat box in live streams, which captured some keys by mistake. Now verified to work as expected. Also picked a better URL for the icon.

  • v1.8 2022-12-01

    version 1.8: Added o to go back 5 seconds, and p to go forward 5 seconds. Works on both the regular player and Shorts.

  • v1.7 2022-11-18

    version 1.7: added Shift + W to open the classic ("wide") player for a YouTube Short, but in a new tab instead of in the current tab like w does. Also added f to switch to fullscreen and back for Shorts, with limited usability since the top and bottom of the video will likely be cut off.

  • v1.6 2022-11-13

    version 1.6: adds support for w to watch a "Shorts" video in the "wide" classic YouTube video player, instead of the feed-based "Shorts" player. Note that this will play only the current Short, and not the next one in the feed. This is mainly useful if you want the regular page with comments and the player's progress bar.

  • v1.5 2022-10-18

    version 1.5: updated the script to work with the updated YouTube UI. The recent redesign changed the structure of the page (especially the area under the video player), and this caused the script to no longer be able to find the like and dislike buttons. A similar redesign was done for the "Shorts" player, and that's now fixed too.

  • v1.4 2022-09-02

    version 1.4: fixed the like/dislike shortcuts for the "Shorts" viewer; they only worked on the first video but not subsequent shorts.

  • v1.3 2022-08-13

    version 1.3: re-implement j, k, l, , ., and 09 on YouTube Shorts player (built-in with the regular player), along with adding b and r.

  • v1.2 2022-06-27

    version 1.2: add support for "YouTube Shorts" vertical viewer, with like/dislike buttons in a different place.

  • v1.1 2022-05-30
    • version 1.1: fix bug where the wrong <video> element was used sometimes.
  • v1.0 2021-12-28