Skip to content

Instantly share code, notes, and snippets.

@kampar
Last active December 18, 2022 03:46
Show Gist options
  • Save kampar/5d6da959041f3b8e4c78 to your computer and use it in GitHub Desktop.
Save kampar/5d6da959041f3b8e4c78 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>M. Jazman, 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>
@kampar
Copy link
Author

kampar commented Mar 26, 2016

source was copied from

Freeman & Robson,
Head First HTML5 Programming
Chapter 9 p. 458

https://github.com/bethrobson/Head-First-HTML5/blob/master/chapter9/bomb.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment