Skip to content

Commit

Permalink
Update background.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NDevTK authored Apr 1, 2022
1 parent d1d4545 commit 51b5406
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ function remove(tabId) {
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (autoPauseWindow !== null && autoPauseWindow !== tab.windowId) return
if (ignoredTabs.has(tabId)) return
if (changeInfo.discarded) {
return remove(tabId);
}
if (hasProperty(changeInfo, 'mutedInfo')) {
if (changeInfo.mutedInfo.muted && media.has(tabId)) {
if (hasProperty(options, 'pausemuted')) send(tabId, 'pausemuted');
Expand All @@ -293,9 +296,6 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
play(tabId, true);
}
}
if (changeInfo.discarded) {
remove(tabId);
}
if (!hasProperty(changeInfo, 'audible')) return // Bool that contains if audio is playing on tab.
if (changeInfo.audible) {
// If has not got a play message from the content script assume theres no permission.
Expand Down

0 comments on commit 51b5406

Please sign in to comment.