您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Volume/Time mouse control for Youtube
当前为
// ==UserScript== // @name YouTube Volume and Time Mouse Controlled // @namespace PoKeRGT // @version 1.01 // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @description Volume/Time mouse control for Youtube // @author PoKeRGT // @match https://www.youtube.com/watch* // @grant none // @homepageURL https://github.com/PoKeRGT/userscripts // @license MIT // ==/UserScript== var videoElement = document.getElementById('movie_player'); function volumeControl(event) { if (event.deltaY > 0) { // mouse wheel up videoElement.setVolume(videoElement.getVolume() - 5); } else { // mouse wheel down videoElement.setVolume(videoElement.getVolume() + 5); } console.log(videoElement.getVolume()); } function timeControl(event) { if (event.deltaY > 0) { // mouse wheel up videoElement.seekToStreamTime(videoElement.getCurrentTime() - 5); } else { // mouse wheel down videoElement.seekToStreamTime(videoElement.getCurrentTime() + 5); } console.log(videoElement.getCurrentTime()); } document.addEventListener('mousewheel', function (event) { var rect = videoElement.getBoundingClientRect(); if (event.clientX > rect.left && event.clientX < rect.right && event.clientY > rect.top && event.clientY < rect.bottom) { cancelScroll(event); if (event.clientX < window.innerWidth / 2) { // left half of the screen volumeControl(event); } else { // right half of the screen timeControl(event); } } }, { passive: false }); function cancelScroll(event) { event.preventDefault(); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址