Skip to content

Instantly share code, notes, and snippets.

@herberthamaral
Created January 13, 2012 16:37
Show Gist options
  • Save herberthamaral/1607387 to your computer and use it in GitHub Desktop.
Save herberthamaral/1607387 to your computer and use it in GitHub Desktop.
storage_flood
// função pra floodar o localStorage, com o intuito de saber se o browser simplesmesnte lança uma
// exception quando o storage está cheio ou se o browser pergunta se o user deseja expandir o
// espaço disponível para o localStorage
function flood(){
for(i=0;i<5*1024*1024;i++) {
window.localStorage.setItem(Math.random().toString(), Math.random().toString())
}
}
@herberthamaral
Copy link
Author

herberthamaral commented Jan 13, 2012 via email

@herberthamaral
Copy link
Author

Ainda no Chrome 18... e o fdp ainda lança exception :/

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