Fast-forward for YT shorts & TikTok

This Userscript adds keyboard shortcuts to YouTube and TikTok videos. It enables quick navigation using the "Left Arrow" key for rewind and the "Right Arrow" key for fast-forwarding in short videos. This feature saves time and helps locate specific moments in a video, making video-watching more efficient.

  1. // ==UserScript==
  2. // @name Fast-forward for YT shorts & TikTok
  3. // @namespace http://tampermonkey.net/
  4. // @license MIT
  5. // @version 0.1.1
  6. // @description This Userscript adds keyboard shortcuts to YouTube and TikTok videos. It enables quick navigation using the "Left Arrow" key for rewind and the "Right Arrow" key for fast-forwarding in short videos. This feature saves time and helps locate specific moments in a video, making video-watching more efficient.
  7. // @author crazy-cat-108
  8. // @match https://www.youtube.com/*
  9. // @match https://www.tiktok.com/*
  10. // @run-at document-start
  11. // @icon https://cdn-icons-png.flaticon.com/512/7696/7696578.png
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. 'use strict';
  17. document.addEventListener('keydown', function (event) {
  18. if (location.pathname.includes('/shorts') || location.host.includes('tiktok.com')) {
  19. const video = document.querySelector("video[loop]") || document.querySelector("video");
  20. if (event.code === 'ArrowLeft') {
  21. video.currentTime -= Math.floor(video.duration * 0.10);
  22. } else if (event.code === 'ArrowRight') {
  23. // Right arrow was pressed
  24. video.currentTime += Math.floor(video.duration * 0.10);
  25. }
  26. }
  27. });
  28. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址