Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Accessibility] Declarative permissions in parent scope for filesystem access via fileURLs #1210

Closed
ghost opened this issue Apr 6, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 6, 2021

Background:

The web was firstly created in order to gain access to files within a local network. However, today, users of a web application can not even access their own files on their own computer...

To solve this problem, many API have been developed for granting filesystem access permissions to applications, but what those API designs do forget, is that the web is not only a browser and a web server, but also the local computer which allows the browser to operate and the content of which can be accessed via fileURLs.

Proposal:

By default, filesystem access should not be made via specific APIs, such a Filesystem Access API, but rather should be incorporated into the Fetch API, via fileURLs, and according to secure permissions contexts (#1209).
FileURLs access from non-fileURLs should thus be allowed in the context of a parent scope permission, that could be granted by the user according to different permissions mechanisms to be defined in a separate issue concerning user-granted permissions.

Example:

<script allow-net="file://path/to/a/document.json">
/* script has access to a particular document via fetchAPI with fileURL*/
fetch('file://path/to/a/document.json')
  .then(response => response.json())
  .then(data => console.log(data));
</script>

<script allow-net="file://path/to/a/documentfolder">
/* script has access to a particular document folder via fetchAPI with fileURLs*/
fetch('file://path/to/a/documentfolder/data.json')
  .then(response => response.json())
  .then(data => console.log(data));
</script>
@domenic
Copy link
Member

domenic commented Apr 6, 2021

Closing per #1209 (comment)

@domenic domenic closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant