summaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-03-24 14:26:36 +0900
committerGitHub <noreply@github.com>2023-03-24 14:26:36 +0900
commit2971bd42e11882202a6f72820b6b7e4ecf2b1f41 (patch)
treede2a05d217ded0acf39e7a66a97c21adb02bf56b /ext/js/background/backend.js
parente358d21b5a35395d91129102ddc0ce69d8e2f078 (diff)
parentfef344c1470764243d06e9d8230c88966ee447d5 (diff)
Merge pull request #106 from Aquafina-water-bottle/fix_browserAction
fix: renamed chrome.browserAction -> chrome.action
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js20
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});
}
}