This file contains hidden or 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
// CM: forked to address key size (not just value size), swapping between KB and MB, ordering by size and logging total localstorage size. | |
// based on answer to question | |
// http://stackoverflow.com/questions/4391575/how-to-find-the-size-of-localstorage | |
(function showLocalStorageSize() { | |
threshold = 256; // the point where we stop displaying KB and start with MB | |
function stringSizeBytes(str) { | |
return str.length * 2; | |
} |