Skip to content

Instantly share code, notes, and snippets.

@tbassetto
tbassetto / fillLocalStorage.js
Created January 20, 2012 15:01
Fill localStorage until the last byte possible
// Only count bytes inserted as values, not counting keys...
(function() {
localStorage.clear();
var nbBytes = 5000, // about 0.5Mb
oneByte = 'x',
i = 0,
totalBytesInserted = 0;
function repeat(string, length) {