← Back to release summary

FileSystemHandle.remove() method

Category
File APIs
Type
No developer-visible change
Status
Enabled by default (Chrome 110)
Intent stage
Dev trials

Summary

A "remove self" method for a FileSystemHandle. Currently, it is not possible to remove a file or directory given its handle. You must obtain the handle of the parent directory and call FileSystemDirectoryHandle.removeEntry(). This method enables the common use case where you obtain a file handle from showSaveFilePicker(), but then decide you don't want to save after all, and delete the file.

Standards & signals

Explainers: https://github.com/whatwg/fs/pull/9 https://github.com/a-sully/fs/pull/1

View on chromestatus.com