Skip to content

Instantly share code, notes, and snippets.

@SimonTheCoder
Created January 10, 2023 04:06
Show Gist options
  • Save SimonTheCoder/af8ffffef46aaa7079c2e8bfa00195ef to your computer and use it in GitHub Desktop.
Save SimonTheCoder/af8ffffef46aaa7079c2e8bfa00195ef to your computer and use it in GitHub Desktop.
Save canvas to image. Use it in browser console.
var clist = document.getElementsByClassName("inner_page");//change class name to yours or use other getElementXXX functions
var newTab = window.open('about:blank','canvase_to_image'); //need enable popup window for current site
for(ind=0;ind<clist.length;ind++){
var dataURL = clist[ind].toDataURL("image/png");
newTab.document.write("<img src='" + dataURL + "' alt='"+clist[ind].id+"'/><br/>");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment