Skip to content

Instantly share code, notes, and snippets.

@TheFantasticWarrior
Last active April 6, 2022 04:37
Show Gist options
  • Save TheFantasticWarrior/3c13d72d8ce4638cc7e88fb3220ed8ca to your computer and use it in GitHub Desktop.
Save TheFantasticWarrior/3c13d72d8ce4638cc7e88fb3220ed8ca to your computer and use it in GitHub Desktop.
Video tool bookmarklet: Uses JavaScript to inject HTML buttons, for changing video speed or skipping ADs/openings/introductions/endings. add to bookmarks to use.
javascript:var%20video=document.querySelector("video");%20%20%20%20%20document.body.addEventListener("ratechange",%20function()%20{%20current.innerHTML=video.playbackRate;%20},%20true);%20%20%20%20%20%20var%20speed%20=%20document.createElement("div");%20%20%20%20%20speed.style%20=%20"background:rgba(255,255,255,0.9);top:0;right:0;position:fixed;z-index:%209999;";%20%20%20%20%20%20var%20left=document.createElement("div");%20%20%20%20%20left.style="display:%20flex;flex-direction:%20column;float:left;";%20%20%20%20%20var%20right=document.createElement("div");%20%20%20%20%20right.style="display:%20flex;flex-direction:%20column;";%20%20%20%20%20%20var%20reset%20=%20document.createElement("button");%20%20%20%20%20reset.innerHTML="%E9%87%8D%E7%BD%AE";%20%20%20%20%20reset.onclick=function(){video.playbackRate=1};%20%20%20%20%20%20var%20uspeed%20=%20document.createElement("button");%20%20%20%20%20uspeed.innerHTML="%E5%BF%AB";%20%20%20%20%20uspeed.onclick=function(){video.playbackRate=video.playbackRate+0.5};%20%20%20%20%20%20var%20dspeed%20=%20document.createElement("button");%20%20%20%20%20dspeed.innerHTML="%E6%85%A2";%20%20%20%20%20dspeed.onclick=function(){video.playbackRate=video.playbackRate-0.25};%20%20%20%20%20%20var%20skip%20=%20document.createElement("button");%20%20%20%20%20skip.innerHTML="%E8%B7%B3OP";%20%20%20%20%20skip.onclick=function(){video.currentTime=video.currentTime+80};%20%20%20%20%20skip.style="";%20%20%20%20%20%20var%20current%20=%20document.createElement("h4");%20%20%20%20%20current.innerHTML="1";%20%20%20%20%20current.style="color:#000";%20%20%20%20%20%20left.appendChild(uspeed);right.appendChild(reset);%20%20%20%20%20left.appendChild(current);%20%20%20%20%20left.appendChild(dspeed);right.appendChild(skip);%20%20%20%20%20speed.appendChild(left);speed.appendChild(right);%20%20%20%20%20document.body.appendChild(speed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment