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
| let entries = []; | |
| let totalSize = 0; | |
| // Collect all localStorage entries with their sizes | |
| for (let key in localStorage) { | |
| if (localStorage.hasOwnProperty(key)) { | |
| let keySize = new Blob([key]).size; // Size of the key | |
| let valueSize = new Blob([localStorage[key]]).size; // Size of the value | |
| let totalEntrySize = keySize + valueSize; | |
| totalSize += totalEntrySize; |