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

HTML5 Filesystem API doesn't work #5177

Closed
tarruda opened this issue Aug 2, 2016 · 6 comments
Closed

HTML5 Filesystem API doesn't work #5177

tarruda opened this issue Aug 2, 2016 · 6 comments

Comments

@tarruda
Copy link

tarruda commented Aug 2, 2016

package.json:

{
  "name": "html5-fs-fail",
  "main": "http://html5-demos.appspot.com/static/filesystem/filer.js/demos/index.html",
  "chromium-args": "--enable-logging=stderr"
}

Opening the page will show 0 bytes of free space and something like this on console: "WARNING:chrome_quota_permission_context.cc(287)] Attempt to request quota from a background page". Chrome shows about 10mb when the user gives permission.

Something else to consider: Chrome asks the user if the app should allow filesystem API access, but for nw.js there should probably be an user-provided callback to decide based on URL.

@timfish
Copy link

timfish commented Aug 13, 2016

I thought nwjs allows any requested quota but you have to actually request a quota. I've got HTML5 filesystem working well on 0.16.1 using cordova-promise-fs which simply uses code like this:

navigator.webkitPersistentStorage.requestQuota(storageSize, function(grantedBytes) {
   window.requestFileSystem(type, grantedBytes, resolve, reject);
}, ...

@Christywl
Copy link
Contributor

Reproduced on Linux/Windows with nwjs-sdk-0.21.2.

@rogerwang
Copy link
Member

@Christywl how did you reproduce it? it should be working ...

@Christywl
Copy link
Contributor

I just used the package.json in the bug.
Log in console:
[10416:10416:0315/062554.429536:WARNING:chrome_quota_permission_context.cc(287)] Attempt to request quota from a background page: 3,7

5177

@rogerwang
Copy link
Member

In browser the user will have to approve the usage. In NW the application needs to apply for quota first as @timfish said.

We could add a callback as reporter proposed, or just let it pass first to make it easier for newcomers.

@rogerwang
Copy link
Member

changed the default setting to allow quota in git. Will be available in the next nightly build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants