Skip to content

Instantly share code, notes, and snippets.

@omarrr
Last active December 22, 2015 08:29
Show Gist options
  • Save omarrr/6445056 to your computer and use it in GitHub Desktop.
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).
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);
@omarrr
Copy link
Author

omarrr commented Sep 5, 2013

How to use:

  1. Enable Chrome's Developer pannel (Mac: Option + Command + I)
  2. Open the Console tab
  3. Paste the code to the console
  4. Done, the image should open in a new tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment