1 function getUsedLocalStorageSpace(){
2 var allStrings = '';
3 for(var key in window.localStorage){
4 if(window.localStorage.hasOwnProperty(key)){
5 allStrings += window.localStorage[key];
6 }
7 }
8 return allStrings ? 3 + ((allStrings.length*16)/(8*1024)) + ' KB' : 'Empty (0 KB)';
9 };
10 getUsedLocalStorageSpace();//