Skip to content

Commit

Permalink
Fixed setBadge for manifestV3 (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
OhMyGuus authored Oct 8, 2022
1 parent 679ff1e commit 549390d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/data/context-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ if (isManifestV3) {

// Badges
function setBadge(tabId, text) {
if (!chrome.browserAction.setBadgeText || !settings.statusIndicators) return;
var chromeAction = chrome?.browserAction ?? chrome?.action;

chrome.browserAction.setBadgeText({ text: text || "", tabId: tabId });
if (!chromeAction || !settings.statusIndicators) return;

if (chrome.browserAction.setBadgeBackgroundColor)
chrome.browserAction.setBadgeBackgroundColor({
chromeAction.setBadgeText({ text: text || "", tabId: tabId });

if (chromeAction.setBadgeBackgroundColor)
chromeAction.setBadgeBackgroundColor({
color: "#646464",
tabId: tabId,
});
Expand Down

0 comments on commit 549390d

Please sign in to comment.