diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-01-31 08:21:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 13:21:44 +0000 |
commit | 8f48d40f7cffc8a0c6f0401dbfc1f3b0422ec21b (patch) | |
tree | bb629051921b72de5a7ae3ba4b22ace1f03d6eef /ext/js | |
parent | 38235b98494a1148391adf240206b0d5a3727be1 (diff) |
Fix chrome.runtime.lastError not working properly on Firefox (#593)
Diffstat (limited to 'ext/js')
-rw-r--r-- | ext/js/extension/web-extension.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/js/extension/web-extension.js b/ext/js/extension/web-extension.js index 95a61339..2aafbe92 100644 --- a/ext/js/extension/web-extension.js +++ b/ext/js/extension/web-extension.js @@ -91,7 +91,8 @@ export class WebExtension extends EventDispatcher { */ getLastError() { const {lastError} = chrome.runtime; - if (typeof lastError !== 'undefined') { + if (lastError) { + if (lastError instanceof Error) { return lastError; } const {message} = lastError; return new Error(typeof message === 'string' ? message : 'An unknown web extension error occured'); } |