Created
September 11, 2012 20:40
-
-
Save mixu/3701854 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = 0; | |
function fillLocalStorage(size) { | |
try { | |
window.localStorage.setItem('data'+i++, new Array(size).join('a')); | |
} catch(e) { | |
if(size == 1) { | |
throw e; | |
} else { | |
return fillLocalStorage(Math.floor(size / 2)); | |
} | |
} | |
console.log('Added ' + size); | |
fillLocalStorage(size); | |
} | |
fillLocalStorage(1024 * 1024); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment