Skip to content

Instantly share code, notes, and snippets.

@biodata-alfarizi
Forked from kampar/localStorage_bomb.html
Last active March 27, 2016 05:05
Show Gist options
  • Save biodata-alfarizi/b0340905a9989c4b123c to your computer and use it in GitHub Desktop.
Save biodata-alfarizi/b0340905a9989c4b123c to your computer and use it in GitHub Desktop.
localStorage bomb to test your browser on how many characters your browser able to save
<html>
<head>
<title>Al-Farizi, Fuse</title>
<meta charset="utf-8">
<script>
localStorage.setItem("fuse", "-");
while(true) {
var fuse = localStorage.getItem("fuse");
try {
localStorage.setItem("fuse", fuse + fuse);
} catch(e) {
alert("Your browser blew up at " + fuse.length + " with exception: " + e);
break;
}
}
localStorage.removeItem("fuse");
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment