您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
seek videos with keyboard in shorts
// ==UserScript== // @name Youtube Shorts button control // @description seek videos with keyboard in shorts // @namespace Violentmonkey Scripts // @match https://www.youtube.com/shorts/* // @grant none // @version 1.0 // @run-at document-idle // @license MIT // @author Sabbir Hossain([email protected]) // @description 4/2/2022, 11:05:09 PM // ==/UserScript== var timer=setInterval(()=>{ console.log('INTERVAL'); if(document.querySelector("#shorts-player > div.html5-video-container > video")!=null){ console.log('IF'); var vid=document.querySelector("#shorts-player > div.html5-video-container > video"); vid.currentTime=vid.currentTime-2; addEventListener("keydown", function(e) { switch (e.key.toUpperCase()) { case "ARROWLEFT": case "A": vid.currentTime=vid.currentTime-5; break; case "ARROWRIGHT": case "D": vid.currentTime=vid.currentTime+5; break; default: console.log(e.key.toUpperCase()); break; } }); clearInterval(timer); } },1000);