Coder Social home page Coder Social logo

a-sully / file-system-access Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wicg/file-system-access

0.0 0.0 0.0 2 MB

Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications.

Home Page: https://wicg.github.io/file-system-access/

License: Other

Bikeshed 100.00%

file-system-access's Introduction

File System Access API

View proposals in the EXPLAINER and the spec.

See changes.md for a list of changes that were made to the API surface between what was available as an Origin Trial in Chrome 83 through Chrome 85, and what will be shipped in Chrome 86.

Problem

Today, if a web site wants to create experiences involving local files (document editor, image compressor, etc.) they are at a disadvantage to native apps. A web site must ask the user to reopen a file every time they want to edit it. After opening, the site can only save changes by re downloading the file to the Downloads folder. A native app, by comparison, can maintain a most recently used list, auto save, and save files anywhere the user wants.

Use cases

  • Open local file to read
  • Open local file to edit and then save
  • Open local file to edit with auto save
  • Create and save a new file
  • Delete an existing file
  • Read meta data about files

Workarounds

  • FileSaver.js polyfills saveAs() from the W3C File API, but files open in a new window instead of downloading on Safari 6.1+ and iOS.

  • In Edge, Firefox, and Chrome developers can:

    • Create a fake anchor element (var a = document.createElement('a'))
    • Set download to the desired filename (a.download = 'file.txt')
    • Set href to a data URI or Blob URL (a.href = URL.createObjectURL(blob))
    • Fake a click on the anchor element (a.click())
    • Clean up if necessary (URL.revokeObjectURL(a.href))

    This is also the approach taken in the browser-fs-access support library.

  • Setting window.location to 'data:application/octet-stream' + data_stream.

  • Hidden Flash controls to display a “save as” dialog.

These methods are clunky and only support “save as” (and depending on the UA may automatically appear in Downloads without prompting the user for location). They do not support most recently used lists, auto save, save, or deleting a file.

file-system-access's People

Contributors

a-sully avatar adanilo avatar alex292 avatar anoesj avatar autokagami avatar benlesh avatar chasephillips avatar darvid7 avatar domenic avatar drufball avatar dslee414 avatar ensonic avatar fivedots avatar foolip avatar hazimmohamed avatar inexorabletash avatar kfdf avatar marcoscaceres avatar martinthomson avatar mkruisselbrink avatar oyiptong avatar pupskuchen avatar pwnall avatar rreverser avatar rstz avatar rumyra avatar sidvishnoi avatar tomayac avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.