Skip to content

Commit

Permalink
fix: check for active tab for disabled icon
Browse files Browse the repository at this point in the history
  • Loading branch information
drodil committed Oct 4, 2024
1 parent 47bf290 commit 22a2f3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions chrome/yt.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,15 @@ chrome.tabs.onActivated.addListener(function (info) {
// Tab update listener
chrome.tabs.onUpdated.addListener(async function (tabId, changeInfo, tab) {
if (!isEnabledForTab(tab)) {
changeIcon(true);
if (tab.active) {
changeIcon(true);
}
return;
}

changeIcon(false);
if (tab.active) {
changeIcon(false);
}
await injectScript(tab);

if (
Expand Down
8 changes: 6 additions & 2 deletions firefox/yt.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ browser.tabs.onActivated.addListener(function (info) {
// Tab update listener
browser.tabs.onUpdated.addListener(async function (tabId, changeInfo, tab) {
if (!isEnabledForTab(tab)) {
changeIcon(true);
if (tab.active) {
changeIcon(true);
}
return;
}

changeIcon(false);
if (tab.active) {
changeIcon(false);
}
await injectScript(tab);

if (
Expand Down

0 comments on commit 22a2f3a

Please sign in to comment.