jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 216 forks source link

Empty `__browserfs_test__` indexedDB database is not deleted #317

Open jcubic opened 2 years ago

jcubic commented 2 years ago

If you use browserFS you end up with two indexedDB databases one is empty and it looks like debug code. It's because of the code that tests if indexedDB is supported:

  public static isAvailable(): boolean {
    // In Safari's private browsing mode, indexedDB.open returns NULL.
    // In Firefox, it throws an exception.
    // In Chrome, it "just works", and clears the database when you leave the page.
    // Untested: Opera, IE.
    try {
      return typeof indexedDB !== 'undefined' && null !== indexedDB.open("__browserfs_test__");
    } catch (e) {
      return false;
    }
  }

The library should clean up after itself.

james-pre commented 1 year ago

@jcubic Is this error still around? If so I can take a look at having BrowserFS clean it up after checking that IndexedDB works.

jcubic commented 1 year ago

I will test if the debug database is still there. I will need to check the latest version, will try when I found some free time, maybe on the weekend.

james-pre commented 8 months ago

Please use https://github.com/zen-fs/core/issues/21