Last active
July 18, 2018 07:53
-
-
Save ebta/2b0524bd05c8e2f57494e79315c90136 to your computer and use it in GitHub Desktop.
Check indexedDB usage size
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
// First method | |
navigator.storage.estimate().then((data)=>console.log(data)) | |
// OR second method | |
navigator.webkitTemporaryStorage.queryUsageAndQuota ( | |
function(usedBytes, grantedBytes) { | |
console.log('we are using ', usedBytes, ' of ', grantedBytes, 'bytes'); | |
}, | |
function(e) { | |
console.log('Error', e); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment