Clear HTML5 Filesystem API Clear HTML5 Filesystem API google-chrome google-chrome

Clear HTML5 Filesystem API


2016 Update: The File API "Directories and System" effort has been abandoned and what little support had made it into browsers is being dropped. The original File API is still valid, but the stuff providing an entire file area on the user's system has been abandoned.


It looks like DirectoryEntry#removeRecursively does that. It says you can't remove the root of a file system, but you can loop through the entries in the root and remove them recursively (or just always work with a subdirectory of the root, thereby letting you remove that with a one-liner).


Not a one line solution but you can always go to

chrome://settings/cookies

and remove the file system from the origin of your choice enter image description here


In bro-fs there is special fs.clear() method exactly for that.

fs.init()  .then(() => fs.mkdir('dir'))  .then(() => fs.writeFile('file.txt', 'hello world'))  .then(() => fs.clear())