Hacker News new | ask | show | jobs
by yread 3 hours ago
But webkitdirectory="true" could already do that, no?
2 comments

No, they're very different. Using webkitdirectory="true" on an <input> element just allows you to select a directory to e.g. upload it to the server. It's a one-time operation.

This API returns a handle to the selected directory, giving the webpage ongoing read/write access to the directory.

You couldn't use the former to e.g. create a local-first notes app that stores its files on disk.

That's read-only.

It's very cool though, and worth learning about for anyone who's unfamiliar.

I have a demo page showing what it can do here: https://tools.simonwillison.net/webkitdirectory