From deb784576eee037dbe0ce0d07d1e753a42f51197 Mon Sep 17 00:00:00 2001 From: Marvin Alexander Krebber Date: Tue, 8 Oct 2024 19:13:35 +0200 Subject: [PATCH] Netflix_scrollVolume --- firefox/cr.js | 4 ++-- firefox/skipper.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/firefox/cr.js b/firefox/cr.js index 99f44ed1..d22030f0 100644 --- a/firefox/cr.js +++ b/firefox/cr.js @@ -102,8 +102,8 @@ async function Crunchyroll_scrollVolume(video) { volumeControl?.addEventListener("wheel", (event) => { event.preventDefault(); let volume = video.volume; - if (event.deltaY < 0) volume = Math.min(1, volume + 0.05); - else volume = Math.max(0, volume - 0.05); + if (event.deltaY < 0) volume = Math.min(1, volume + 0.1); + else volume = Math.max(0, volume - 0.1); video.volume = volume; const sliderKnob = document.querySelector('div[data-testid="vilos-volume_slider"]').children[1].firstChild.firstChild; sliderKnob.style.transform = `translateX(${volume * 61}px) translateX(-8px) scale(1)`; diff --git a/firefox/skipper.js b/firefox/skipper.js index b9683c70..f00e27ef 100644 --- a/firefox/skipper.js +++ b/firefox/skipper.js @@ -502,8 +502,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO volumeControl.classList.add("enhanced"); volumeControl?.addEventListener("wheel", (event) => { let volume = video.volume; - if (event.deltaY < 0) volume = Math.min(1, volume + 0.05); - else volume = Math.max(0, volume - 0.05); + if (event.deltaY < 0) volume = Math.min(1, volume + 0.1); + else volume = Math.max(0, volume - 0.1); video.volume = volume; const sliderContainer = volumeControl.querySelector(".slider-container"); sliderContainer.firstChild.children[1].style.strokeDashoffset = 100 - volume * 100 + "px"; @@ -750,12 +750,14 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO const volumeControl = document.querySelector('[data-uia*="control-volume"]:not(.enhanced)'); if (volumeControl) { volumeControl.classList.add("enhanced"); - volumeControl?.addEventListener("wheel", (event) => { + const handleVolumeControl = (event) => { let volume = video.volume; if (event.deltaY < 0) volume = Math.min(1, volume + 0.05); else volume = Math.max(0, volume - 0.05); video.volume = volume; - }); + }; + removeEventListener("wheel", handleVolumeControl); + volumeControl?.addEventListener("wheel", handleVolumeControl); } } // to parse html umlaut symbols like ä to รค @@ -903,8 +905,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO volumeControl?.addEventListener("wheel", (event) => { const video = document.querySelector(AmazonVideoClass); let volume = video.volume; - if (event.deltaY < 0) volume = Math.min(1, volume + 0.05); - else volume = Math.max(0, volume - 0.05); + if (event.deltaY < 0) volume = Math.min(1, volume + 0.1); + else volume = Math.max(0, volume - 0.1); video.volume = volume; }); }