Skip to content

Instantly share code, notes, and snippets.

@ebta
Last active July 18, 2018 07:53
Show Gist options
  • Save ebta/2b0524bd05c8e2f57494e79315c90136 to your computer and use it in GitHub Desktop.
Save ebta/2b0524bd05c8e2f57494e79315c90136 to your computer and use it in GitHub Desktop.
Check indexedDB usage size
// 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