WICG / file-system-access

Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications.
https://wicg.github.io/file-system-access/
Other
654 stars 65 forks source link

Options accept accepts more extensions than were desired #444

Open drbsoftware opened 4 months ago

drbsoftware commented 4 months ago

There is a problem with the implementation specs in 3.2.1 To process accept types ... which results in difficulties when using the current Chrome and Edge browsers.

There are cases where multiple extensions use the same MIME types, such as image/jpeg, text/plain, text/html. With the current spec it is not possible to ask for only one of the extensions, This is because the spec is basically an OR of the MIME type and the extensions. 'text/plain': ['.txt'] will ask the Chrome or Edge user for .txt AND .text.

Currently the only workaround is to use a meaningless MIME type, for example: 'foo/bar': ['.txt']

Several backward-compatible solutions may be possible: