0

I have 672.4 GB of available storage as seen in the image below. But when I open Chrome and try to view my available local storage I get much less, about 291MB.

First, how do I clear the 120MB being used?

Second, how do I increase this available storage?

navigator.storage.estimate().then((data)=>console.log(data)) enter image description here

enter image description here

John
  • 87
  • 1
  • 11
  • 3
    It's _browser_ local storage, not all the available storage on your harddrive. There's a setting/privacy option in Chrome where you can clear your cache/site data. – Andy Jun 08 '21 at 20:50
  • Please never write an arrow function that looks like `x => f(x)` – ElectricShadow Jun 08 '21 at 20:51
  • https://stackoverflow.com/questions/2989284/what-is-the-max-size-of-localstorage-values – ssbarbee Jun 08 '21 at 20:51
  • @ElectricShadow `.then(console.log)` doesn't work because the `this` binding is wrong, so the arrow function is necessary. – Ben West Jun 08 '21 at 20:52
  • 3
    @ElectricShadow Statements like that should include some reasoning. – charlietfl Jun 08 '21 at 20:55
  • @BenWest If the purpose is to manipulate the `this` binding, then doing it in that way is very obscure. It is much better to use `.then(console.log.bind(this))` – ElectricShadow Jun 08 '21 at 20:55
  • https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria – evolutionxbox Jun 08 '21 at 20:56
  • 2
    Your browser is a sandbox, meaning when it runs, it allows you limited access to your OS, including memory. – symlink Jun 08 '21 at 20:57
  • @ElectricShadow `x => f(x)` is useful sometimes, for example: `const foo = ["bar", "baz"]; foo.forEach((str) => console.log(str));` because `foo.forEach(console.log);` also prints out the `index` and `array` variables that are also passed into a callback function inside of `Array.prototype.forEach` – Samathingamajig Jun 08 '21 at 21:07
  • @Samathingamajig You're right. I didn't think of that. I think presetting arguments that don't come first would be the only time when `x => f(x)` would be okay. If the arguments do come first or you need to set the value of `this` to that of the current scope, use `Function.prototype.bind` instead. – ElectricShadow Jun 09 '21 at 15:10
  • @Andy Any reason why the browser local storage is .01% of my total HD size? Is there any way to increase this? – John Jun 09 '21 at 18:45
  • @symlink already answered that. For security concerns your local storage size is limited to your browser settings. [This might help your understanding](https://stackoverflow.com/questions/2989284/what-is-the-max-size-of-localstorage-values) – Andy Jun 09 '21 at 19:35
  • @Andy That refers to the limit per storage item right? Not the total size of the indexeddb? What browser setting can I change to increase the total size? It should be more than .01% right? – John Jun 09 '21 at 20:44

0 Answers0