Skip to content

Instantly share code, notes, and snippets.

@staktrace
Created October 18, 2019 18:11
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 staktrace/e310827753ce057005de36c450d16344 to your computer and use it in GitHub Desktop.
Save staktrace/e310827753ce057005de36c450d16344 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function crashit() {
var arr = new Array();
for (var i = 0; i < 300000; i++) {
arr[i] = (i % 256);
}
var blob = 'data:application/pdf,' + arr;
var link = document.createElement("a");
link.download = "attachment";
link.href = blob;
link.textContent = "really"
document.body.appendChild(link);
link.click();
}
</script>
</head>
<body>
<a href="#" onclick="crashit(); return false;">click here</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment