mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-14 23:47:04 +03:00
Reduced errors by getting if the channel is whitelisted after checking it is is a YouTube tab.
This commit is contained in:
40
popup.js
40
popup.js
@@ -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
|
//if the don't show notice again letiable is true, an option to
|
||||||
// disable should be available
|
// disable should be available
|
||||||
chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) {
|
chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) {
|
||||||
@@ -292,6 +272,26 @@ function runThePopup() {
|
|||||||
SB.videoFound.innerHTML = "No sponsors found"
|
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) {
|
function setVideoID(request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user