You're currently using about <span id="percent"></span>% of your estimated
storage quota (<span id="quota"></span>).StorageManager: estimate() method / notebook
StorageManager: estimate() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
navigator.storage.estimate().then((estimate) => {
document.getElementById("percent").textContent = (
(estimate.usage / estimate.quota) *
100
).toFixed(2);
document.getElementById("quota").textContent =
`${(estimate.quota / 1024 / 1024).toFixed(2)}MB`;
});