Skip to content

Commit

Permalink
Fix: Set extension badge
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Oct 14, 2023
1 parent 9148dd7 commit b939c69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/scripts/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ chrome.action.onClicked.addListener(async (tab) => {
if (tab.id === undefined) return;
chrome.tabs.sendMessage(tab.id, "reload").catch((e) => console.error(e));
});

chrome.runtime.onStartup.addListener(async () => {
const isEnable = await getIsEnabled();
chrome.action.setBadgeText({ text: isEnable ? "ON" : "OFF" });
console.log("enabled:", isEnable);
});

0 comments on commit b939c69

Please sign in to comment.