🏠 back to Observable

Accessing the Native File system

I heard about the Native File System today and thought it would be so useful for database storage.

So I had a play with it and got stuck.

The windows.chooseFileSystemEntries() keeps yelling at me,
SecurityError: Failed to execute ‘chooseFileSystemEntries’ on ‘Window’: Cross origin sub frames aren’t allowed to show a file picker.

But I have no problem running it from the console.

Could it be a CORS issue of something else?

Unfortunately this looks like it won’t be possible based on the security design of this feature:

  1. The API will deny requests for user decisions coming from 3rd-party frames.

You could petition the browser vendors to add support for this. Alternatively, it might be possible for Observable to pass-through access to native files in the future, like we’ve done for FileAttachment.

In the meantime here’s another way to read local files:

1 Like