Albin
Albin

Reputation: 306

In some mobiles I get the error navigator.storage.getDirectory() is not a function

I'm using Origin Private File System inside a PWA, so it's served under HTTPS.

Mobiles are using Chrome version 115.

When the code tries to get the root directory navigator.storage.getDirectory() the error "getDirectory()" is logged in console.

It happens inside a WebWorker and also in DevTools console.

let root = null;

(async function () {
    root = await navigator.storage.getDirectory()
    postMessage('storage_ready');
})();

However, navigator.storage.persistence() returns true and navigator.storage.estimate() returns data. So the object StoreManager is returned by navigator but seems to be somehow incomplete.

I have tried to figure out the reason, why to return an object which affirms that it has persistence but it doesn´t have the method to access to the virtual file system ...

I have checked Chrome configuration, privacy configuration, PWA as App configuration, ... but I don´t find a clue.

It happend with version 114 and after updated Chrome worked but minutes later failed again.

Upvotes: 0

Views: 382

Answers (0)

Related Questions