[mv3] Attempt at mitigation for when "internal error" occurs

Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/199
This commit is contained in:
Raymond Hill 2024-09-06 09:31:17 -04:00
parent 08e5bffc76
commit bec5d53ce0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 9 additions and 0 deletions

View File

@ -386,8 +386,17 @@ async function start() {
}
}
// https://github.com/uBlockOrigin/uBOL-home/issues/199
// Force a restart of the extension once when an "internal error" occurs
try {
start();
localWrite({ goodStart: true });
} catch(reason) {
console.trace(reason);
localRead.get('goodStart').then((bin = {}) => {
if ( bin.goodStart !== true ) { return; }
localWrite({ goodStart: false }).then(( ) => {
runtime.reload();
});
});
}