Fix updateBadge (custom sites disabled)
parent
a7414841b1
commit
1b5e965e2f
|
@ -761,6 +761,7 @@ function updateBadge (activeTab) {
|
|||
let currentUrl = activeTab.url;
|
||||
if (currentUrl) {
|
||||
let isDefaultSite = matchUrlDomain(defaultSites_domains, currentUrl);
|
||||
let isCustomSite = matchUrlDomain(customSites_domains, currentUrl);
|
||||
if (isSiteEnabled({url: currentUrl})) {
|
||||
badgeText = 'ON';
|
||||
color = 'red';
|
||||
|
@ -771,11 +772,28 @@ function updateBadge (activeTab) {
|
|||
badgeText = 'OFF';
|
||||
color = 'blue';
|
||||
}
|
||||
if (!isDefaultSite) {
|
||||
if (isCustomSite) {
|
||||
ext_api.permissions.contains({
|
||||
origins: ["<all_urls>"]
|
||||
}, function (result) {
|
||||
if (!result)
|
||||
badgeText = '';
|
||||
if (color && badgeText)
|
||||
ext_api.browserAction.setBadgeBackgroundColor({color: color});
|
||||
ext_api.browserAction.setBadgeText({text: badgeText});
|
||||
});
|
||||
} else {
|
||||
ext_api.browserAction.setBadgeText({text: ''});
|
||||
}
|
||||
} else {
|
||||
ext_api.browserAction.setBadgeBackgroundColor({color: color});
|
||||
ext_api.browserAction.setBadgeText({text: badgeText});
|
||||
}
|
||||
}
|
||||
ext_api.browserAction.setBadgeBackgroundColor({color: color});
|
||||
ext_api.browserAction.setBadgeText({text: badgeText});
|
||||
}
|
||||
|
||||
|
||||
function site_switch() {
|
||||
ext_api.tabs.query({
|
||||
active: true,
|
||||
|
|
|
@ -6,6 +6,7 @@ Add Deutsche Wirtschafts Nachrichten
|
|||
Add WirtschaftsWoche (Germany)
|
||||
Fix-update Quartz (newsletter)
|
||||
Fix-update Sueddeutsche Zeitung (+ magazine)
|
||||
Fix updateBadge (custom site disabled)
|
||||
Icon for dark/incognito mode (Chrome)
|
||||
Save options to storage.local (quota exceeded)
|
||||
|
||||
|
|
|
@ -321,6 +321,7 @@
|
|||
"*://*.destentor.nl/*",
|
||||
"*://*.tubantia.nl/*",
|
||||
"storage",
|
||||
"tabs",
|
||||
"webRequest",
|
||||
"webRequestBlocking"
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue