Skip to content

Instantly share code, notes, and snippets.

@neopunisher
Created May 26, 2018 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neopunisher/f4850a28d5d829ff632b702c08b03b24 to your computer and use it in GitHub Desktop.
Save neopunisher/f4850a28d5d829ff632b702c08b03b24 to your computer and use it in GitHub Desktop.
take a pic of the current html with svg magic
(function(url, inj) {
inj(url).then(function() {
html2canvas(document.body).then(function(canvas) {
document.body.appendChild(canvas);
});
})
})('https://html2canvas.hertzen.com/dist/html2canvas.min.js', (src, head = true) => new Promise(function(c, d) {
var a = document.createElement("script");
a.src = src;
a.type = "text/javascript";
a.onload = c;
a.onerror = d;
document[head ? 'head' : 'body'].appendChild(a)
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment