mirror of https://github.com/gorhill/uBlock.git
Decouple error handling of lists loading from selfie loading
This commit make it so that if an *unexpected* error is thrown when trying to load the selfie at launch, the filter lists will still be loaded as a result.
This commit is contained in:
parent
219f4607a2
commit
043ae117c8
|
@ -293,17 +293,23 @@ try {
|
||||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/817#issuecomment-565730122
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/817#issuecomment-565730122
|
||||||
// Still try to load filter lists regardless of whether a serious error
|
// Still try to load filter lists regardless of whether a serious error
|
||||||
// occurred in the previous initialization steps.
|
// occurred in the previous initialization steps.
|
||||||
|
let selfieIsValid = false;
|
||||||
try {
|
try {
|
||||||
const selfieIsValid = await µb.selfieManager.load();
|
selfieIsValid = await µb.selfieManager.load();
|
||||||
if ( selfieIsValid === true ) {
|
if ( selfieIsValid === true ) {
|
||||||
log.info(`Selfie ready ${Date.now()-vAPI.T0} ms after launch`);
|
log.info(`Selfie ready ${Date.now()-vAPI.T0} ms after launch`);
|
||||||
} else {
|
|
||||||
await µb.loadFilterLists();
|
|
||||||
log.info(`Filter lists ready ${Date.now()-vAPI.T0} ms after launch`);
|
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.trace(ex);
|
console.trace(ex);
|
||||||
}
|
}
|
||||||
|
if ( selfieIsValid !== true ) {
|
||||||
|
try {
|
||||||
|
await µb.loadFilterLists();
|
||||||
|
log.info(`Filter lists ready ${Date.now()-vAPI.T0} ms after launch`);
|
||||||
|
} catch (ex) {
|
||||||
|
console.trace(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Final initialization steps after all needed assets are in memory.
|
// Final initialization steps after all needed assets are in memory.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue