Closed Bug 1690764 Opened 3 years ago Closed 3 years ago

browser.browsingData.remove API works incorrectly

Categories

(WebExtensions :: General, defect)

Firefox 85
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1313401

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:

  1. Create some extension with "browsingData" permission.
  2. Add some data to localStorage in background page.
  3. 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})

  1. 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.

The documentation correctly says that originTypes is not supported: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browsingData/RemovalOptions

Component: Untriaged → General
Product: Firefox → WebExtensions

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 !

Flags: needinfo?(devunion)

(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).

Flags: needinfo?(devunion)

(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.

Luca to look if we have a related bug.

Flags: needinfo?(lgreco)

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.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(lgreco)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.