-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathytspeed.min.js
More file actions
1 lines (1 loc) · 1.01 KB
/
ytspeed.min.js
File metadata and controls
1 lines (1 loc) · 1.01 KB
1
javascript:krazete:function getCurrentVideo(){var e,t=Array.from(document.getElementsByTagName("video"));t.sort((e,t)=>!t.paused-!e.paused);for(e of t){if(e.paused&&!t[0].paused)break;var n=e.getBoundingClientRect();if(0<n.bottom&&n.top<innerHeight)return e}return t[0]}function initDash(){var e,t=document.createElement("div"),n=(t.style.position="fixed",t.style.right="0",t.style.bottom="0",t.style.zIndex="4999",document.createElement("div")),n=(n.textContent="❌",n.addEventListener("click",function(){t.remove()}),t.appendChild(n),document.createElement("input")),i=(n.type="range",n.min=0,n.max=1,n.step=.1,n.value=.7,n.addEventListener("input",function(){getCurrentVideo().style.filter="brightness("+this.value+")"}),t.appendChild(n),document.createElement("div"));for(e of[1,2,3,5,10]){var a=document.createElement("button");a.value=e,a.textContent="x"+e,i.appendChild(a)}i.addEventListener("click",function(e){getCurrentVideo().playbackRate=parseInt(e.target.value)}),t.appendChild(i),document.body.appendChild(t)}initDash();