Closed
Bug 1416219
Opened 7 years ago
Closed 5 years ago
The extension pages localStorage should not be cleared on privacy.sanitize.sanitizeOnShutdown = true
Categories
(WebExtensions :: Storage, defect, P2)
WebExtensions
Storage
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1313401
People
(Reporter: rpl, Unassigned)
References
Details
Currently, if a user configures the following privacy settings:
- Load about:preferences#privacy in a tab
- In the History section choose
"Firefox will use custom settings for history"
- Check “Clear history when Firefox closes”
All the extensions localStorage data is dropped when Firefox is closed.
The reason is that, when the underlying about:config preference "privacy.sanitize.sanitizeOnShutdown" is enabled, a opClearAll will be executed by the StorageDBThread on exit, and this will currently remove all the data from the sqlite3 DB using a "DELETE FROM webappsstore2":
https://searchfox.org/mozilla-central/rev/30ead7d1ae5bf95b8bc0fd67b950cd46ca05e32c/dom/storage/StorageDBThread.cpp#1222-1238
Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
(In reply to Luca Greco [:rpl] from comment #0)
> - Check “Clear history when Firefox closes”
Thanks Luca. What are the settings in this test? I suspect that if you tick everything EXCEPT "cookies", the issue does not occur (this is my exact setup and I do not lose any web extension local storage). If you can confirm that, then the issue can be narrowed down to `privacy.clearOnShutdown.cookies` + web extension local storage.
Comment 2•7 years ago
|
||
^^ sorry, I meant IF privacy.sanitize.sanitizeOnShutdown=>true AND privacy.clearOnShutdown.cookies=true
Reporter | ||
Comment 3•7 years ago
|
||
(In reply to Simon Mainey from comment #1)
> (In reply to Luca Greco [:rpl] from comment #0)
> > - Check “Clear history when Firefox closes”
>
> Thanks Luca. What are the settings in this test? I suspect that if you tick
> everything EXCEPT "cookies", the issue does not occur (this is my exact
> setup and I do not lose any web extension local storage). If you can confirm
> that, then the issue can be narrowed down to
> `privacy.clearOnShutdown.cookies` + web extension local storage.
Yes, I confirm that it is related to the combination of both is
`privacy.clearOfShutdown.cookies = true` (which is the default)
and `privacy.sanitize.sanitizeOnShutdown = true`.
If privacy.clearOnShutdown.cookie is set to false, even with privacy.sanitize.sanitizeOnShutdown = true,
the localStorage is not cleared (not only for the extensions but for all the web pages as well).
Comment 4•7 years ago
|
||
Also to consider: when manually clearing history (ctrl-shift-del) and cookies is checked - the pref for this is `privacy.cpd.cookies`
The "clear all history" dialog options mirror the preferences UI, and I would assume that eventually they use the same code for deciding what and how to clear. Just want to make sure it's not missed
Reporter | ||
Comment 5•7 years ago
|
||
(In reply to Simon Mainey from comment #4)
> Also to consider: when manually clearing history (ctrl-shift-del) and
> cookies is checked - the pref for this is `privacy.cpd.cookies`
>
> The "clear all history" dialog options mirror the preferences UI, and I
> would assume that eventually they use the same code for deciding what and
> how to clear. Just want to make sure it's not missed
Thanks Simon!
There is definitely an additional scenario in that dialog, to be precise
when "Offline WebSites Data" is selected in the "Clear Recent History..." dialog
(which corresponds to privacy.cpd.offlineApps)
the extensions localStorage data is going to be dropped (by the same opClearAll that it is executed in the scenario described by this issue):
- https://searchfox.org/mozilla-central/rev/30ead7d1ae5bf95b8bc0fd67b950cd46ca05e32c/browser/base/content/sanitize.js#289-290,296-297
- https://searchfox.org/mozilla-central/rev/30ead7d1ae5bf95b8bc0fd67b950cd46ca05e32c/dom/storage/StorageObserver.cpp#316,333,336
Comment 6•7 years ago
|
||
^^ just to clarify: Offline Website Data = indexedDB = profile/storage/default
Clearing OWD manually and on close does not remove any extension IDB entries (FF56) - eg I have uMatrix and uBlock Origin IDB moz-extension directories - I do this all the time: as I said my "clear on exit" settings are everything but cookies - and I set the same for manual for time range everything and I run that frequently as well). It also does not remove any extension local storage that I know of - eg my Stylus and Violentmonkey storage is not affected
There WAS an issue where the time range produced different results - but that was fixed.
I'm not a coder :-( .. are you saying clearing OWD manually can clear extension localStorage? Because I cannot produce that (when I use time range "everything")
Updated•7 years ago
|
Component: WebExtensions: General → WebExtensions: Storage
Comment 7•7 years ago
|
||
A little more light on the subject. This requires the Storage API to be enabled. FF56 has the two prefs at false, FF57 flipped them to true ( see Bug 1399398 ). The prefs are dom.storageManager.enabled and browser.storageManager.enabled. Hence I did not replicate in 56 as per last comment
So the real problem is
- If clear on shutdown is enabled and clearing OWD is checked (same when done manually in Clear Recent History), AND Storage API is enabled, then Web Extension local storage etc is cleared
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Though it does not appear the case but wondering nonetheless whether perhaps the patch for bug #1286798 would eventually also resolve this one?
Afaik Chrome retains the localStroage content for addons and only purges web page content.
As it is right now it is rather tedious to restore WE settings retained in localStroge after each (re)start of the browser.
Reporter | ||
Updated•5 years ago
|
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•