[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

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 { try {
start(); start();
localWrite({ goodStart: true });
} catch(reason) { } catch(reason) {
console.trace(reason); console.trace(reason);
localRead.get('goodStart').then((bin = {}) => {
if ( bin.goodStart !== true ) { return; }
localWrite({ goodStart: false }).then(( ) => {
runtime.reload();
});
});
} }