Skip to content

Commit

Permalink
[mv3] Attempt at mitigation for when "internal error" occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 6, 2024
1 parent 08e5bff commit bec5d53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions platform/mv3/extension/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
}

0 comments on commit bec5d53

Please sign in to comment.