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

Remove permission prompts when using Chrome Native File System API #7351

Closed
AshleyScirra opened this issue Jan 31, 2020 · 7 comments
Closed
Assignees

Comments

@AshleyScirra
Copy link

AshleyScirra commented Jan 31, 2020

NWJS Version : 0.44 (beta)
Operating System : Windows 10 64-bit

Expected behavior

When using Chrome's Native File System API (instead of the node fs API), permission prompts should be automatically approved.

Actual behavior

Permission prompts still appear, as they do in the Chrome browser. However these are redundant as in NW.js, the app has permission to access files already.

How to reproduce

Minimal repro:
https://www.dropbox.com/s/70n9ahropz8olxi/nwjs-native-filesystem-api.zip?dl=0

Try the following steps:

  1. Click 'Pick folder' and select a folder
  2. Observe "Let site view files?" permission prompt (approve it)
  3. Click 'Save'
  4. Observe "Save changes to folder?" permission prompt

Note: this currently requires "chromium-args": "--enable-features=NativeFileSystemAPI" in package.json since the Native File System API is currently in origin trial, but is scheduled to be enabled by default later this year.

@AshleyScirra
Copy link
Author

Any chance this could be looked at? It's blocking us switching over our file system implementation. Thanks.

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@AshleyScirra
Copy link
Author

Great, thank you!

@AshleyScirra
Copy link
Author

I'm afraid the issue is actually only partially fixed. I tested with 0.44.6 which says it includes the change. The prompt at step 2 is gone, but there is still a prompt at step 4.

Looking at the change here: nwjs/chromium.src@857688b

In chrome_native_file_system_permission_context.cc, there was a change to auto-grant permission in ConfirmDirectoryReadAccess, but the name suggests that it does not cover directory write access or read/write access for individual files, all of which can also prompt.

Another smaller issue is if you pick a special folder like "Documents" that is blocked for security reasons, it shows a message that includes the chrome extension name, which isn't very user friendly:
nwjs-special-folder-message
It would be nice if this could show the application name, or just allow special folder access as well. But this is a smaller issue, I could live with this as long as the permission prompts are automatically approved.

@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@AshleyScirra
Copy link
Author

Thanks, will check this out soon.

@AshleyScirra
Copy link
Author

I can confirm everything appears to be working OK in the latest nightly. Thank you very much!

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

No branches or pull requests

2 participants