Open Bug 1401482 Opened 7 years ago Updated 2 years ago

Opening storage inspector creates a (DOM) cache storage

Categories

(DevTools :: Storage Inspector, defect, P3)

defect

Tracking

(firefox57 fix-optional)

Tracking Status
firefox57 --- fix-optional

People

(Reporter: tt, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce:
1. Open a fresh website (says https://www.foo.com)
2. Check current storage directory (profile/storage/default/) and the folder "https+++www.foo.com" doesn't exist (it means foo.com have not store anything yet). Besides, if we checking "Site Data" in Preferences at this moment, we cannot find entries called "www.foo.com"
3. Open the storage inspector
4. Check the current storage directory again

Expected behavior:
The folder "https+++www.foo.com" shouldn't exist since it has not stored anythings yet.

Actual behavior:
The folder "https+++www.foo.com" is created, and it has one entries "cache" (It means it stores somethings by (DOM) Cache API). Besides, you can find out "www.foo.com" in the "Site Data"'s list with 64 KBs.
Maybe open the storage inspector on a website creates a service worker on that website?
I guess I find the reason why the storage inspector create a (DOM) cache directory under the origin of browsing window. Storage inspector using caches.keys() to find all the cache storages [1]. However, it will create the (DOM) cache directory if the directory hasn't been created yet.

Maybe instead of using (DOM) cache's API to check the storage under the origin directly, only using the API when the origin has created storage via that API.

To do this, we can have a method in QuotaManagerService to get which storage type (e.g., IndexedDB, DOM Cache) is using under the origin of browsing window from the QuotaManger. And then, we get the storage of the storage type (e.g., DOM Cache) by that API (e.g., DOM Cache) only if the API (e.g., DOM Cache) is used in origin. So that, we won't create the directory if the website hasn't used the API yet. 

[1] http://searchfox.org/mozilla-central/rev/2ef8bd8a46a02c68ddbb1d5f25fa254dd7be1fbd/devtools/server/actors/storage.js#1366
See Also: → 1399753
See Also: → 1423917
Has STR: --- → yes
Priority: -- → P3
Product: Firefox → DevTools

Maybe related to Bug 1488733 ?

See Also: → 1488733
Blocks: 1312444
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.