"Forget about this Site" clears all AppCache
Categories
(Toolkit :: Data Sanitization, defect, P3)
Tracking
()
People
(Reporter: Gavin, Assigned: ns19041997, Mentored)
References
(Blocks 2 open bugs)
Details
Updated•7 years ago
|
Comment 1•6 years ago
|
||
Another example of how to clear this can be found here:
https://searchfox.org/mozilla-central/rev/c21d6620d384dfb13ede6054015da05a6353b899/browser/modules/SiteDataManager.jsm#192-220
https://searchfox.org/mozilla-central/rev/c21d6620d384dfb13ede6054015da05a6353b899/browser/modules/SiteDataManager.jsm#314-318
However, I wonder if it might be enough to use asyncDoomURI
here:
https://searchfox.org/mozilla-central/source/netwerk/cache2/nsICacheStorage.idl#129-130
Honza, can you confirm that something like
let appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
appCacheStorage.asyncDoomURI(uri, callback);
would work for clearing AppCache only for a certain host?
Thanks!
Comment 2•6 years ago
|
||
(In reply to Johann Hofmann [:johannh] from comment #1)
However, I wonder if it might be enough to use
asyncDoomURI
here:https://searchfox.org/mozilla-central/source/netwerk/cache2/nsICacheStorage.idl#129-130
Honza, can you confirm that something like
let appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null); appCacheStorage.asyncDoomURI(uri, callback);
would work for clearing AppCache only for a certain host?
Thanks!
"Asynchronously removes an entry belonging to the URI" is the comment for asyncDoomURI. It says nothing about origin or scoping. It only removes a single entry in 1-1 relation with the URI.
No, that is not the way to clear origin.
Hi,
I would like to work on this!
Could this be assigned to me?
Thanks!
Updated•6 years ago
|
Comment 5•6 years ago
|
||
(In reply to Neha from comment #3)
Hi,
I would like to work on this!
Could this be assigned to me?
Thanks!
Sure, thanks for jumping on this one. I can try to find some time to help you as I'm the owner of appcache. Just let you know that:
- this bug may not be that simple to fix because there may be (I would have to look) no API or even an unexposed mechanism to clear appcache per origin
- appcache treatment is only to fix security, serious stability or functionality issue, but nothing more
Updated•6 years ago
|
Hello Johann, Honza,
how can I check whether the cache has been cleared or not?
So I know if the changes I make are working.
Thanks!
Comment 7•6 years ago
|
||
Load http://webdbg.com/test/appcache/. In the (local) part of the profile you will see a directory called OfflineCache
. Some time after you have visited that page there should be subdirs in it. After delete, they should be gone. You can also examine the index.sqlite file with sqlite3 shell. select * from moz_cache_groups;
should show results when there is something in appcache, and nothing when it's been cleared.
Comment 8•6 years ago
|
||
OK, a better (working, actually) app can be found here: https://archive.jonathanstark.com/labs/app-cache-2b/
Comment 9•6 years ago
|
||
I also wrote on IRC that we test AppCache in automated tests like this: https://searchfox.org/mozilla-central/rev/4763b8d576ce52625d245d1ab6d9404ea025b026/browser/components/preferences/in-content/tests/siteData/browser_clearSiteData.js#12-14
Not super great, but the best I can think of.
Assignee | ||
Comment 10•6 years ago
|
||
Hi Johann, Honza!
I visited https://archive.jonathanstark.com/labs/app-cache-2b/ and then queried for select * from moz_cache_groups;
which returned the following:
https://archive.jonathanstark.com/labs/app-cache-2b/demo.manifest#|https%3A//archive.jonathanstark.com/labs/app-cache-2b/demo.manifest%23|0000001553244367|0|1553244369
Then I did "Forget about this site" from the history and ran the query again. The query returns empty and there are folders with name - 1,2,4,6,A,D
with subdirs that are also emptied.
I think that the issue has already been fixed. I ran this experiment on these two versions of Firefox with same results. Could you please review if I am missing something!
- Nightly 67.0a1 (2019-02-25) (64-bit)
- Quantum 65.0.1 (64-bit)
Thanks!
Comment 11•6 years ago
|
||
Just for completeness, have you checked that before you do "forget about this site" the content is present? (the sql query returns something and there are files in the subdirectories)
Assignee | ||
Comment 12•6 years ago
|
||
Yes, the subdirs contain some images and files and the sql query returns results as described in comment#10. On doing 'forget site', both the subdirs and sql query are empty!
Thanks!
Comment 13•6 years ago
|
||
Could I ask you for one more test? If you do "forget about this site" for a completely DIFFERENT domain, does it affect the stored appcache data for the domain you have tested with in comment 10?
Thanks.
Assignee | ||
Comment 14•6 years ago
|
||
Yes, if we do "forget about this site" for any domain other than https://archive.jonathanstark.com/labs/app-cache-2b/, then also the subdirs are emptied and sql query returns no results.
So I guess the issue now is not that "forget about this site" doesn't clear appcache, rather it clears all appcache? If yes, then let's close this one and open a new issue. I would be happy to take a look at what is causing this.
Thanks!
Comment 15•6 years ago
|
||
I strongly discourage against it. This bug was about ensuring that we delete the data for the the domain, which we do. If we also delete all other appcaches, then it's a bug, yes, but if you file it, it will be given P5 and forgotten about.
We don't fix ANY appcache bugs unless they are stability, critical or major functionality issues, which this bug would be neither of. Appcache is considered an obsolete webtech and we encourage people to use service workers instead.
Closing this as WFM and many thanks for spending time on testing this! Much appreciated!
Comment 16•6 years ago
•
|
||
Ah, sorry, there's been a misunderstanding here. After some more recent changes to improve robustness of clearing site data "Forget About this Site" indeed does delete AppCache, because it hits this function: https://searchfox.org/mozilla-central/rev/2c912888e3b7ae4baf161d98d7a01434f31830aa/toolkit/components/cleardata/ClearDataService.jsm#285
Now, that is also not really what it's supposed to do, because that deletes all AppCache, not just the one from the host that Forget about this Site passes. I should have clarified that that is what we want to fix in the bug title.
Considering that we'd like to get rid of AppCache, it's probably fine to leave this closed, though.
Comment 17•6 years ago
|
||
Thanks for the clarification. Seconded.
Description
•