Last active
December 22, 2015 08:29
-
-
Save omarrr/6445056 to your computer and use it in GitHub Desktop.
Fix for Google Chrome "Screen Capture" extension bug #310 (https://code.google.com/p/chrome-screen-capture/issues/detail?id=310).
This file contains 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
function downloadCapture(forceDownload) | |
{ | |
var canvas = document.getElementById("canvas"); | |
var image = canvas.toDataURL("image/png"); | |
if (forceDownload) | |
image = image.replace("data:image/png;base64", "data:application/octet-stream;base64"); | |
window.open(image, "_blank"); | |
} | |
// If you'd rather save the image directly, change the value for 'true' | |
downloadCapture(false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use: