diff --git a/lib/background.ts b/lib/background.ts index 539996f..8ed6d48 100644 --- a/lib/background.ts +++ b/lib/background.ts @@ -378,7 +378,10 @@ locale.then(() => { console.error("Invalid Handler for", menuItemId); return; } - handler.call(this, info, tab).catch(console.error); + const rv = handler.call(this, info, tab); + if (rv && rv.catch) { + rv.catch(console.error); + } } async enumulate(action: string) {