Need a working code with only javascript and no extra library files (-> jquery,...) That take a screenshot from the whole webpage. (top to bottom page)
Current i have this which does not work why?
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
var window = document.getElementById('item');
var canvas = document.getElementById('my-canvas');
var ctx = canvas.getContext("2D");
ctx.drawImage(window, 0,0, 100, 200, "rgb(255,255,255)");
canvas.toDataURL("image/png");
});
</script>
</head>
<body id="item">
test website
<canvas id='my-canvas'></canvas>