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