Created
December 2, 2025 17:10
-
-
Save Damian96/2828d3ee7ba10a6c761a12503dab4bc5 to your computer and use it in GitHub Desktop.
Youtube FullScreen Video Screenshot - Bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ | |
| try{ | |
| function exitFS(){ | |
| let d=document; | |
| (d.exitFullscreen||d.webkitExitFullscreen||d.mozCancelFullScreen||d.msExitFullscreen)?.call(d); | |
| } | |
| function requestFS(el){ | |
| (el.requestFullscreen||el.webkitRequestFullscreen||el.mozRequestFullScreen||el.msRequestFullscreen)?.call(el); | |
| } | |
| var v=document.querySelector("video"); | |
| if(!v){alert("No video found!");return;} | |
| if(confirm("Enter fullscreen mode before capturing?")){ | |
| requestFS(v); | |
| setTimeout(capture,400); | |
| } else { | |
| capture(); | |
| } | |
| function capture(){ | |
| var c=document.createElement("canvas"); | |
| c.width=v.videoWidth; | |
| c.height=v.videoHeight; | |
| var x=c.getContext("2d"); | |
| x.drawImage(v,0,0,c.width,c.height); | |
| var a=document.createElement("a"); | |
| a.href=c.toDataURL("image/jpeg"); | |
| a.download="video_screenshot_"+Date.now()+".jpg"; | |
| a.click(); | |
| exitFS(); | |
| } | |
| }catch(e){alert("Screenshot error: "+e);} | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment