Broken filter storage in Firefox private mode
Environment
- Browser and full version: Firefox 100.0
- Extension using this toolkit: test-mv2
- Commit hash: d9f77593
Steps to reproduce
- Open about:preferences#privacy.
- In the History section, select "Use custom settings for history" and select "Always use private browsing mode".
Note: Selecting "Never remember history" should have the same effect. - Install test-mv2 extension.
- Go to about:addons and click on the test extension list item.
- Change "Run in Private Windows" to "Allow".
- Run
await EWE.filters.add(["foooo"])
. - Run
await EWE.filters.getUserFilters()
. - Reload the test extension.
- Run
await EWE.filters.getUserFilters()
.
Actual behavior
- After 5) Below error is shown in background page JavaScript console.
- After 7) Returns an array with one filter object in it.
- After 8) Below error is shown in background page JavaScript console.
- After 9) Returns an empty array.
Uncaught (in promise) DOMException: A mutation operation was attempted on a database that did not allow mutations. idb.js:40
onerror idb.js:40
(Async: EventHandlerNonNull)
openDatabase idb.js:40
openDatabase idb.js:29
initializationPromise idb.js:49
init idb.js:60
start initializer.js:57
startAsyncModule initializer.js:29
startupPromise initializer.js:57
start initializer.js:63
start index.js:105
startAsyncModule index.js:67
start index.js:105
<anonymous> background.js:170
Expected behavior
- After 5) No error is shown in background page JavaScript console.
- After 7) Returns an array with one filter object in it.
- After 8) No error is shown in background page JavaScript console.
- After 9) Returns an array with one filter object in it.
Further information
This problem has been observed by multiple Adblock Plus users following the release of its first version that's based on EWE. There are indications that problems with extensions using IndexedDB while in "always private mode" has already been around for years (see Reddit thread). Therefore this regression may have been introduced by the decision to use IndexedDB for storing filter data in EWE, which used to be stored via browser.storage.local
in previous versions.
Edited by Thomas Greiner