Update style, use isObject
This commit is contained in:
parent
dee7d924a8
commit
66ef730119
@ -868,8 +868,7 @@ 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('')
|
||||
@ -878,11 +877,7 @@ class Backend {
|
||||
|
||||
_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