Skip to content

Commit

Permalink
fix: issue with badge not updating when window is opened/closed/focused
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlieb committed Apr 13, 2022
1 parent 6d16131 commit 7d603dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions background_scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ browser.tabs.onCreated.addListener(
checkSettings(tab, false);
});

browser.windows.onRemoved.addListener(
(tab) => {
checkSettings(tab, true);
});

browser.windows.onCreated.addListener(
(tab) => {
checkSettings(tab, false);
});

browser.windows.onFocusChanged.addListener(
(tab) => {
checkSettings(tab, false);
});

browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.type == "Settings changed") {
checkSettings();
Expand Down

0 comments on commit 7d603dd

Please sign in to comment.