browser.browsingData.remove API works incorrectly
Categories
(WebExtensions :: General, defect)
Tracking
(Not tracked)
People
(Reporter: devunion, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36
Steps to reproduce:
- Create some extension with "browsingData" permission.
- Add some data to localStorage in background page.
- Call the next code:
browser.browsingData.remove({since: 0, originTypes: {
unprotectedWeb: true,
protectedWeb: false,
extension: false
}}, {localStorage: true})
or
browser.browsingData.remove({since: 0}}, {localStorage: true})
- Check localStorage. It will be empty
Actual results:
The above API calls removing extension data from localStorage.
Expected results:
In accordance with the official docomentation, data in localStorage of the extension should not be removed.
P.S. I'm not sure if it affects localStorage only. May be some other data types will be removed too.
Comment 1•3 years ago
|
||
The documentation correctly says that originTypes is not supported: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browsingData/RemovalOptions
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Hello,
I’m from QA and I’m attempting to reproduce and confirm the issue you are encountering. Could you by any chance attach the extension you used when you encountered the issue?
Thank you !
(In reply to Tom Schuster [:evilpie] from comment #1)
The documentation correctly says that originTypes is not supported: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browsingData/RemovalOptions
I see, thank you. But does it possible at least to make FF behavior compatible with Chrome? Chrome does not have extension
option at all. And it does not remove any data from the scope of extension.
At the moment it is impossible to clean up user data and does not affect extension data without some workarounds (save extension state, remove data, init back extension state from the previously saved values).
(In reply to Alex Cornestean from comment #2)
Hello,
I’m from QA and I’m attempting to reproduce and confirm the issue you are encountering. Could you by any chance attach the extension you used when you encountered the issue?
Thank you !
Unfortunately, I can't. This is large commercial project which we're trying to port for Firefox.
Comment 6•3 years ago
|
||
This issue is technically a duplicate of Bug 1313401 (in that bug we mention explicitly the issue when triggered by a user clearing websites localStorage from about:preferences, but browsingData is using the same internals and so the two issues do have the same underlying root cause).
As part of Bug 1313401 we landed a new test case that make sure that when LSNG (NextGen LocalStorage) is enabled the extensions' localStorage data isn't cleared along with the data from webpages, but at the moment LSNG is only enabled by default on Nightly and so we are keeping Bug 1313401 open until Bug 1599979 is being fixed.
Description
•