Update style, use isObject

This commit is contained in:
toasted-nutbread 2020-04-17 19:19:38 -04:00
parent dee7d924a8
commit 66ef730119

View File

@ -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;
}