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

Test for storagemanager ability to persist data #2689

Open
marcuspuchalla opened this issue Mar 10, 2022 · 0 comments
Open

Test for storagemanager ability to persist data #2689

marcuspuchalla opened this issue Mar 10, 2022 · 0 comments

Comments

@marcuspuchalla
Copy link

Question

Can a specific test be created to check if a browser can be triggered/forced to store user data permanently?

Description

There is a Persistence permission in browsers to flag data for being persisted permanently in the users' browser.

In, e.g., Firefox https://developer.mozilla.org/en-US/docs/web/api/storagemanager#browser_compatibility, one can use the StorageManager to ask for that permission.

From what I see, there is currently no specific test in Modernizr that can be queried to get info if this is available on the user's browser.

From what I've read, it uses the StorageAPI and refers to a "box modes". This mode can either be "best-effort" or "persistent".

"best-effort" means that the data could be removed if the user runs low on disk space.
"persistent" won't wipe that data, even if disk space is low.

All I found atm is

  • "quotamanagement", which is not sufficient enough to judge if data can be persisted
  • "indexeddb", which on its own can be both "best-effort" or "persistent"

Problem

  • Firefox will ask the user for permission if he wants to store data permanently.
  • Brave will also ask, but in addition will ask for how long the data shall be stored.
  • Chrome, however is a little bit intransparent on this. It will determine if it's allowed based on the user activity. While it's not clear to me what this means in detail. But if e.g., the user has given an allowance for 'notification', Chrome will also allow persisting data.
  • For mobile browsers I haven't tested it with all browser/os combinations, but e.g. on Safari iOS it's not possible at all.

References

https://storage.spec.whatwg.org/#persistence

https://caniuse.com/mdn-api_permissions_persistent-storage_permission

https://web.dev/persistent-storage/

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

1 participant