check chrome.windows support before using

This commit is contained in:
siikamiika 2020-02-09 21:11:35 +02:00
parent 9fbd47e4ea
commit 1797edc7d8

View File

@ -629,6 +629,10 @@ class Backend {
chrome.tabs.create({url});
return;
case 'popup':
if (!isObject(chrome.windows)) {
// chrome.windows not supported (e.g. on Firefox mobile)
return;
}
if (this.popupWindow !== null) {
const callback = () => this.checkLastError(chrome.runtime.lastError);
chrome.windows.remove(this.popupWindow.id, callback);