diff options
author | Darius Jahandarie <djahandarie@gmail.com> | 2023-03-24 14:26:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-24 14:26:36 +0900 |
commit | 2971bd42e11882202a6f72820b6b7e4ecf2b1f41 (patch) | |
tree | de2a05d217ded0acf39e7a66a97c21adb02bf56b /ext/js/background | |
parent | e358d21b5a35395d91129102ddc0ce69d8e2f078 (diff) | |
parent | fef344c1470764243d06e9d8230c88966ee447d5 (diff) |
Merge pull request #106 from Aquafina-water-bottle/fix_browserAction
fix: renamed chrome.browserAction -> chrome.action
Diffstat (limited to 'ext/js/background')
-rw-r--r-- | ext/js/background/backend.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index c8eb47b9..5f42b4c9 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -1379,16 +1379,16 @@ class Backend { _getBrowserIconTitle() { return ( - isObject(chrome.browserAction) && - typeof chrome.browserAction.getTitle === 'function' ? - new Promise((resolve) => chrome.browserAction.getTitle({}, resolve)) : + isObject(chrome.action) && + typeof chrome.action.getTitle === 'function' ? + new Promise((resolve) => chrome.action.getTitle({}, resolve)) : Promise.resolve('') ); } _updateBadge() { let title = this._defaultBrowserActionTitle; - if (title === null || !isObject(chrome.browserAction)) { + if (title === null || !isObject(chrome.action)) { // Not ready or invalid return; } @@ -1437,17 +1437,17 @@ class Backend { } } - if (color !== null && typeof chrome.browserAction.setBadgeBackgroundColor === 'function') { - chrome.browserAction.setBadgeBackgroundColor({color}); + if (color !== null && typeof chrome.action.setBadgeBackgroundColor === 'function') { + chrome.action.setBadgeBackgroundColor({color}); } - if (text !== null && typeof chrome.browserAction.setBadgeText === 'function') { - chrome.browserAction.setBadgeText({text}); + if (text !== null && typeof chrome.action.setBadgeText === 'function') { + chrome.action.setBadgeText({text}); } - if (typeof chrome.browserAction.setTitle === 'function') { + if (typeof chrome.action.setTitle === 'function') { if (status !== null) { title = `${title} - ${status}`; } - chrome.browserAction.setTitle({title}); + chrome.action.setTitle({title}); } } |