---
number: 6023
title: main.addon.FileSystemAccessAPI   access local file system via picker dialogs
author: gplanansky
state: MERGED
createdAt: '2024-10-08T09:11:10Z'
updatedAt: '2024-10-08T10:48:41Z'
closedAt: '2024-10-08T10:48:41Z'
mergedAt: '2024-10-08T10:48:41Z'
head: dev
base: dev
url: 'https://github.com/neomjs/neo/pull/6023'
---
**This PR adds the one file: src/main/addon/FileSystemAccessAPI.mjs**

**Basic support for the File System Access API:*

Supplies  methods `showDirectoryPicker(), showOpenFilePicker(), showSaveFilePicker()`;  plus the convenience method `supported() ` to test if a browser supports this API.

**Useful Information:**

The "_File System API"_ is available in Web Workers.
However the "_File System Access API_" _extensions_ are Not available in Web Workers,
because the extensions must handle _user gestures_ and Web Workers do Not have access to the
UI thread aka main thread.   Therefore we must add this support via the Neo main/addon approach,

Supported by Chrome, Edge, Opera, but not and never FireFox:
https://developer.chrome.com/docs/capabilities/web-apis/file-system-access#browser_support

Tested with Neo on Chrome, Opera, Edge.

See: https://wicg.github.io/file-system-access   W3C Community File System Access Report

**Reason for this support:**  

Quoting from the above W3C Report:

_This API enables developers to build powerful apps that interact with other (non-Web) apps on the user’s device via the device’s file system. Prominent examples of applications where users expect this functionality are IDEs, photo and video editors, text editors, and more._

In particular, "more" includes  data input files, user-generated annotated data output files, and user-determined session configuration state files, typical of data science and data analysis applications.  For instance, GIS applications.   Such "desktop" applications use the local file system extensively,  to read and persist user-generated files, and do not merely display data from the cloud.

So this is a minimal addon that provides maximal support for Desktop applications.
It could also serve the purpose of a minimalist first exercise in coding main addons.

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix
- [x] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [x] It's submitted to the `dev` branch, _not_ the `main` branch

## Comments

### `@tobiu` commented on 2024-10-08T10:48:32Z

looks good. merging it in and will add a minor cleanup. thx george!

---

