Update style, use isObject
This commit is contained in:
parent
dee7d924a8
commit
66ef730119
@ -868,21 +868,16 @@ class Backend {
|
||||
|
||||
_getBrowserIconTitle() {
|
||||
return (
|
||||
chrome.browserAction !== null &&
|
||||
typeof chrome.browserAction === 'object' &&
|
||||
isObject(chrome.browserAction) &&
|
||||
typeof chrome.browserAction.getTitle === 'function' ?
|
||||
new Promise((resolve) => chrome.browserAction.getTitle({}, resolve)) :
|
||||
Promise.resolve('')
|
||||
new Promise((resolve) => chrome.browserAction.getTitle({}, resolve)) :
|
||||
Promise.resolve('')
|
||||
);
|
||||
}
|
||||
|
||||
_updateBadge() {
|
||||
let title = this._defaultBrowserActionTitle;
|
||||
if (
|
||||
title === null ||
|
||||
chrome.browserAction === null ||
|
||||
typeof chrome.browserAction !== 'object'
|
||||
) {
|
||||
if (title === null || !isObject(chrome.browserAction)) {
|
||||
// Not ready or invalid
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user