check chrome.windows support before using
This commit is contained in:
parent
9fbd47e4ea
commit
1797edc7d8
@ -629,6 +629,10 @@ class Backend {
|
|||||||
chrome.tabs.create({url});
|
chrome.tabs.create({url});
|
||||||
return;
|
return;
|
||||||
case 'popup':
|
case 'popup':
|
||||||
|
if (!isObject(chrome.windows)) {
|
||||||
|
// chrome.windows not supported (e.g. on Firefox mobile)
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.popupWindow !== null) {
|
if (this.popupWindow !== null) {
|
||||||
const callback = () => this.checkLastError(chrome.runtime.lastError);
|
const callback = () => this.checkLastError(chrome.runtime.lastError);
|
||||||
chrome.windows.remove(this.popupWindow.id, callback);
|
chrome.windows.remove(this.popupWindow.id, callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user