Skip to content

Instantly share code, notes, and snippets.

@bnjm
Created May 30, 2018 14:47
Show Gist options
  • Save bnjm/d058e3490e0f6968a191ca6ed202c705 to your computer and use it in GitHub Desktop.
Save bnjm/d058e3490e0f6968a191ca6ed202c705 to your computer and use it in GitHub Desktop.
(async()=>{
let blob = await new Promise(resolve=>document.querySelector('canvas').toBlob(resolve))
let url = URL.createObjectURL(blob)
window.open(url)
let a = document.createElement('a')
a.href = url
a.download = ''
a.click()
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment