mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Fixed clear times button having incorrect behavior.
This commit is contained in:
@@ -75,7 +75,7 @@ chrome.runtime.onMessage.addListener( // Detect URL Changes
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (request.message == "changeStartSponsorButton") {
|
if (request.message == "changeStartSponsorButton") {
|
||||||
changeStartSponsorButton(request.visibility, request.uploadButtonVisible);
|
changeStartSponsorButton(request.showStartSponsor, request.uploadButtonVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.message == "changeVideoPlayerControlsVisibility") {
|
if (request.message == "changeVideoPlayerControlsVisibility") {
|
||||||
@@ -235,8 +235,8 @@ function startSponsorClicked() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeStartSponsorButton(visibility, uploadButtonVisible) {
|
function changeStartSponsorButton(showStartSponsor, uploadButtonVisible) {
|
||||||
if (visibility) {
|
if (showStartSponsor) {
|
||||||
showingStartSponsor = true;
|
showingStartSponsor = true;
|
||||||
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
|
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
|
||||||
|
|
||||||
|
|||||||
3
popup.js
3
popup.js
@@ -243,14 +243,13 @@ function getSponsorTimesMessage(sponsorTimes) {
|
|||||||
function clearTimes() {
|
function clearTimes() {
|
||||||
//send new sponsor time state to tab
|
//send new sponsor time state to tab
|
||||||
if (sponsorTimes.length > 0) {
|
if (sponsorTimes.length > 0) {
|
||||||
let visibility = sponsorTimes[sponsorTimes.length - 1].length >= 2;
|
|
||||||
chrome.tabs.query({
|
chrome.tabs.query({
|
||||||
active: true,
|
active: true,
|
||||||
currentWindow: true
|
currentWindow: true
|
||||||
}, function(tabs) {
|
}, function(tabs) {
|
||||||
chrome.tabs.sendMessage(tabs[0].id, {
|
chrome.tabs.sendMessage(tabs[0].id, {
|
||||||
message: "changeStartSponsorButton",
|
message: "changeStartSponsorButton",
|
||||||
visibility: visibility,
|
showStartSponsor: true,
|
||||||
uploadButtonVisible: false
|
uploadButtonVisible: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user