Try to use data from storage.local if connecting to indexedDB fails
Background
Until recently we didn't knew that in some cases (root cause unknown) Edge has trouble with IndexedDB
and any attempt to open/create a db return UnknownError
.
In this scenario, even if the user has a backup of their filters, we don't use it, but instead show them the corruption page.
What to change
Improve the error handling inioIndexedDB
, if the error is UnknownError
, check if a backup is present in local.storage
, and if so, use that data.
Testing notes
Because we don't know exactly in what scenarios IndexedDB stops working correctly, besides the test cases for the first run page, a way to simulate the failure, would be to work with the source code directly:
In adblockpluschrome\lib\ioIndexedDB.js
change openDB
to
function openDB()
{
return Promise.reject("reason");
}