handle closing already closed popup

This commit is contained in:
siikamiika 2020-02-02 14:58:31 +02:00
parent d7f0369281
commit 8d56d6ffcb

View File

@ -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'},