Skip to content

Instantly share code, notes, and snippets.

@mattn
Created June 30, 2009 08:53
Show Gist options
  • Save mattn/138075 to your computer and use it in GitHub Desktop.
Save mattn/138075 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript">
window.addEventListener('load', function() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
var canvas = document.createElement('canvas');
canvas.style.display = "none";
canvas.left = 0;
canvas.top = 0;
canvas.width = 300;
canvas.height = 300;
document.getElementsByTagName('body')[0].appendChild(canvas);
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, 300, 300);
ctx.save();
ctx.scale(1.0, 1.0);
ctx.drawWindow(window, 0, 0, 300, 300, "rgb(255,255,255)");
ctx.restore();
location.href = canvas.toDataURL("image/png");
}, false);
</script>
</head>
<body>
あああああああああああああああああああああああああああああ<br />
いいいいいいいいいいいいいいいいいいいいいいいいいいいいい<br />
ううううううううううううううううううううううううううううう<br />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment