aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-02-02 14:58:31 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-02-09 21:51:33 +0200
commit8d56d6ffcb0f02e1edaf4193e182e95bfe7d22c5 (patch)
tree63ce25ad21b19aff1c0177950d12ee5f08f1d1d3 /ext/bg/js/backend.js
parentd7f0369281f8e9f036d87be392828e81d8187e74 (diff)
handle closing already closed popup
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 06010a95..a9f2385b 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -628,7 +628,8 @@ class Backend {
return;
case 'popup':
if (this.popupWindow !== null) {
- chrome.windows.remove(this.popupWindow.id);
+ const callback = () => this.checkLastError(chrome.runtime.lastError);
+ chrome.windows.remove(this.popupWindow.id, callback);
}
this.popupWindow = await new Promise((resolve) => chrome.windows.create(
{url, width: popupWidth, height: popupHeight, type: 'popup'},