Skip to content

Commit

Permalink
Code review of fix re "internal error"
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 22, 2024
1 parent 687475e commit ff57f01
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions platform/mv3/extension/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,14 @@ 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();
start().then(( ) => {
localWrite({ goodStart: true });
} catch(reason) {
}).catch(reason => {
console.trace(reason);
localRead.get('goodStart').then((bin = {}) => {
if ( bin.goodStart !== true ) { return; }
localRead('goodStart').then((bin = {}) => {
if ( bin.goodStart === false ) { return; }
localWrite({ goodStart: false }).then(( ) => {
runtime.reload();
});
});
}
});

0 comments on commit ff57f01

Please sign in to comment.