diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-17 19:19:38 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-18 21:12:54 -0400 |
commit | 66ef7301198e4baa827fafe002818896a8bb6483 (patch) | |
tree | 4fec6fcc3b023f36a2a27e335025841e178d5d1b /ext/bg | |
parent | dee7d924a8555226721bbbdb045b86a21426f60b (diff) |
Update style, use isObject
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/backend.js | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 9f466647..aacebd2c 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -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; } |