Created
January 23, 2025 06:38
-
-
Save dansp89/925aa8ca9553142c82b8f448a7705fdc to your computer and use it in GitHub Desktop.
Download blob with JS
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
const videoElement = document.querySelector('video'); | |
if (videoElement && videoElement.src.startsWith('blob:')) { | |
const a = document.createElement('a'); | |
a.href = videoElement.src; | |
a.download = 'video.mp4'; | |
document.body.appendChild(a); | |
a.click(); | |
document.body.removeChild(a); | |
} else { | |
console.error('ERROR blob not found!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment