navigator.storage.persist() should grant persistent storage for extensions
Reported by
stu...@testtrack4.com,
Jan 12 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: I have a Chrome extension that stores user documents using PouchDB. (For performance reasons, storing the documents with a non-indexed storage facility like chrome.storage is not an option.) Users have complained about losing all their data in low-disk-space scenarios, due to Chrome's eviction handling around IndexedDB. If I call navigator.storage.persist().then(console.log.bind(console)) in that extension, the request to persist storage is rejected (logging `false`). What is the expected behavior? What went wrong? Since Chrome extensions go above and beyond the high-level criteria for a page to be granted persistent storage described in the comments of https://developers.google.com/web/updates/2016/06/persistent-storage (it is something that unequivocably matters to the user), they should be given persistent storage when requesting it. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 55.0.2883.87 Channel: stable OS Version: 10.0 Flash Version:
,
Mar 18 2017
Can somebody please implement this? My extension has users who are losing data due to this omission.
,
Aug 23 2017
Just checking: has any progress been made toward making storage for Chrome extensions granted without rejection by default?
,
Apr 5 2018
Hi, I’m seeing this too. `navigator.storage.persist()` resolves to `false`. Chrome: 65.0.3325.181 (Official Build) (64-bit) OS: Mac OS 10.13.2 Inside a chrome extension that has the permissions: ["activeTab", "storage", "unlimitedStorage"] I tried also testing on Windows 7.0.0 Chrome 49, but `navigator.storage` is undefined :D **I would love to have an answer as to whether or not extensions with `unlimitedStorage` will persist IndexedDB data or if they’re at risk of the browser evicting this data, and if this changed anywhere between Chrome 49–present.**
,
Apr 5 2018
Extension origins with "unlimitedStorage" will not be evicted under storage pressure.
,
Jun 6 2018
And this is true when using indexedDB?
,
Jun 7 2018
,
Jun 26 2018
Would someone care to translate all this for the average Chrome user who isn't a "Script Kiddie"? I'm asking "Is the problem solved now or is Chrome still kicking the can down the road?" I'm here because of Onetab and Tabalanche issues with data loss. I see a comment/claim by jsb...@chromium.org, Apr 5, namely: "Extension origins with "unlimitedStorage" will not be evicted under storage pressure." What does this mean exactly? Does it mean "Problem solved"? Does it mean "Problem solved if all the app guys read this and add the script to their program?" Look Chrome guys, millions are jumping ship permanently from MS because of Windows 10, even the poor ones like me who have to save for a Mac. So help me Jesus I'll never buy another new Windows machine as long as I live We expect better from Chrome. Please don't make me start Googling "Is Firefox better than chrome 2018?" Ok, rant finished........ Waiting for an answer.
,
Jun 27 2018
I would like to take the opportunity to remind readers of Chromium's Code of Conduct https://chromium.googlesource.com/chromium/src/+/master/CODE_OF_CONDUCT.md Community discussions should be respectful and kind; about Chromium; about features and code, not the individuals involved. Regarding the root of question #8 - those extensions shouldn't need durable storage, as they can already request unlimited storage. If there is a reason why this isn't sufficient, then please let us know.
,
Aug 3
,
Aug 3
Issue 829570 has been merged into this issue.
,
Aug 6
@9 - my 2 cents on your question: > If there is a reason why this isn't sufficient, then please let us know. For me, the issue when I posted in April was that it just wasn’t clear what "unlimitedStorage" applied to and didn’t apply to and for my particular example, I wasn’t sure if I could expect IndexedDB data to persist (given that `navigator.storage.persist()` was giving mixed signals). It looks like other people were confused too. I found it very helpful and encouraging to get a response here that it does indeed persist, despite `navigator.storage.persist()` returning false. I’ve been able to move on from this as a result, but it would likely help other developers to shore up the documentation for "unlimitedStorage" and/or review how `navigator.storage.persist()` works in relation to this setting. I don’t have enough familiarity with the implications of this, so I’d assume the prior one would be safer :D
,
Aug 6
I think that since we already (effectively) grant persistent storage to extensions, the API should reflect that - pwnall@, any reason to not have storage.persist() return Promise.resolve(true) for extension contexts?
,
Oct 7
@12 If I get you right it sounds like you assume that IndexedDB persists. Unfortunately I could not find a statement regarding this anywhere in the thread. And the Permission Specs for Chrome Extensions say in regards to "UnlimitedStorage": "Note: This permission applies only to Web SQL Database and application cache (see issue 58985 ). Also, it doesn't currently work with wildcard subdomains such as http://*.example.com." Link: https://developer.chrome.com/apps/declare_permissions So not only asking you(#12), but in general: Does unlimitedStorage give persisted storage to IndexedDB?
,
Oct 8
@14 - based on the input from @chromium.org folks in this issue, **yes**, IndexedDB data does persist if you have "unlimitedStorage" set in your manifest.json file, e.g., `"permissions": ["unlimitedStorage"]`
,
Oct 30
It looks like there is unclear & out of date documentation here. |
||||
►
Sign in to add a comment |
||||
Comment 1 by jsb...@chromium.org
, Jan 12 2017Components: -Blink>Storage Blink>Storage>Quota
Labels: -Type-Bug Type-Feature
Status: Available (was: Unconfirmed)