Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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())
}
}
@diegocaxito

This comment has been minimized.

Copy link

@diegocaxito diegocaxito commented Jan 13, 2012

Chrome lança exception!!!

@herberthamaral

This comment has been minimized.

Copy link
Owner Author

@herberthamaral herberthamaral commented Jan 13, 2012

So o opera que não lança, pelos meus testes até agora. Ainda não consegui testar no safari.

@diegocaxito

This comment has been minimized.

Copy link

@diegocaxito diegocaxito commented Jan 13, 2012

E pra variar o Firefox trava!!

@herberthamaral

This comment has been minimized.

Copy link
Owner Author

@herberthamaral herberthamaral commented Jan 13, 2012

Safari também lança exception...

@suissa

This comment has been minimized.

Copy link

@suissa suissa commented Jan 13, 2012

Vixiii q osso, mas ae Herbeth o Opera lança a pergunta neh?

@herberthamaral

This comment has been minimized.

Copy link
Owner Author

@herberthamaral herberthamaral commented Jan 13, 2012

@herberthamaral

This comment has been minimized.

Copy link
Owner Author

@herberthamaral herberthamaral commented Apr 15, 2012

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