Skip to content

Commit

Permalink
Correctly report errors when webextension-polyfill is loaded in Chrome
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
fregante committed Jan 23, 2021
1 parent a78f6cc commit 861bb03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async function handleClick(
executeCode(
tab.id,
'alert' /* Can't pass a raw native function */,
String(error)
String(error instanceof Error ? error : new Error(error.message))
).catch(() => {
alert(error); // One last attempt
});
Expand Down

0 comments on commit 861bb03

Please sign in to comment.