Page 1 of 1

How to check avaialble space for IndexedDB in Chrome?

Posted: Mon Nov 11, 2024 4:40 pm
by admin
Press F12 and in Console paste following code,

Code: Select all

if (navigator.storage && navigator.storage.estimate) {
  const quota = await navigator.storage.estimate();
  // quota.usage -> Number of bytes used.
  // quota.quota -> Maximum number of bytes available.
  const percentageUsed = (quota.usage / quota.quota) * 100;
  console.log(`You've used ${percentageUsed}% of the available storage.`);
  const remaining = (quota.quota - quota.usage)/1024/1024;
  console.log(`You can write up to ${remaining} more MB.`);
}
indexedDB.jpg