diff options
author | Ajay Ramachandran <[email protected]> | 2019-08-10 20:57:11 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-08-10 20:57:11 -0400 |
commit | 30c12e398371eda8c3496d87a3d8a063dbbf83ab (patch) | |
tree | b3d6cdfea250e0e42b0dea40bff73451374a36f1 /popup.js | |
parent | 15d6a48359926aadc9e769760889bc9db7b673ba (diff) | |
download | SponsorBlock-30c12e398371eda8c3496d87a3d8a063dbbf83ab.tar.gz SponsorBlock-30c12e398371eda8c3496d87a3d8a063dbbf83ab.zip |
Reduced errors by getting if the channel is whitelisted after checking it is is a YouTube tab.
Diffstat (limited to 'popup.js')
-rw-r--r-- | popup.js | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -123,26 +123,6 @@ function runThePopup() { } }); - //see if whitelist button should be swapped - chrome.tabs.query({ - active: true, - currentWindow: true - }, tabs => { - chrome.tabs.sendMessage( - tabs[0].id, - {message: 'isChannelWhitelisted'}, - function(response) { - if (response.value) { - SB.whitelistChannel.style.display = "none"; - SB.unwhitelistChannel.style.display = "unset"; - - SB.downloadedSponsorMessageTimes.innerText = "Channel Whitelisted!"; - SB.downloadedSponsorMessageTimes.style.fontWeight = "bold"; - } - }); - } - ); - //if the don't show notice again letiable is true, an option to // disable should be available chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) { @@ -292,6 +272,26 @@ function runThePopup() { SB.videoFound.innerHTML = "No sponsors found" } } + + //see if whitelist button should be swapped + chrome.tabs.query({ + active: true, + currentWindow: true + }, tabs => { + chrome.tabs.sendMessage( + tabs[0].id, + {message: 'isChannelWhitelisted'}, + function(response) { + if (response.value) { + SB.whitelistChannel.style.display = "none"; + SB.unwhitelistChannel.style.display = "unset"; + + SB.downloadedSponsorMessageTimes.innerText = "Channel Whitelisted!"; + SB.downloadedSponsorMessageTimes.style.fontWeight = "bold"; + } + }); + } + ); } function setVideoID(request) { |