From 572bab27a0a8bf9adb8542db8eb85de710478eaf Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Mon, 26 Aug 2019 02:40:54 +0200 Subject: [PATCH] menu handlers are not necessary promises --- lib/background.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {