mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Made popup toggle image of player control as well.
This commit is contained in:
19
content.js
19
content.js
@@ -154,6 +154,16 @@ function addPlayerControlsButton() {
|
|||||||
addPlayerControlsButton();
|
addPlayerControlsButton();
|
||||||
|
|
||||||
function startSponsorClicked() {
|
function startSponsorClicked() {
|
||||||
|
toggleStartSponsorButton();
|
||||||
|
|
||||||
|
//send back current time with message
|
||||||
|
chrome.runtime.sendMessage({
|
||||||
|
message: "addSponsorTime",
|
||||||
|
time: v.currentTime
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleStartSponsorButton() {
|
||||||
if (showingStartSponsor) {
|
if (showingStartSponsor) {
|
||||||
showingStartSponsor = false;
|
showingStartSponsor = false;
|
||||||
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker256px.png");
|
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker256px.png");
|
||||||
@@ -161,12 +171,6 @@ function startSponsorClicked() {
|
|||||||
showingStartSponsor = true;
|
showingStartSponsor = true;
|
||||||
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
|
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
//send back current time with message
|
|
||||||
chrome.runtime.sendMessage({
|
|
||||||
message: "addSponsorTime",
|
|
||||||
time: v.currentTime
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Opens the notice that tells the user that a sponsor was just skipped
|
//Opens the notice that tells the user that a sponsor was just skipped
|
||||||
@@ -258,6 +262,9 @@ function sponsorMessageStarted() {
|
|||||||
message: "time",
|
message: "time",
|
||||||
time: v.currentTime
|
time: v.currentTime
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//update button
|
||||||
|
toggleStartSponsorButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getYouTubeVideoID(url) { // Returns with video id else returns false
|
function getYouTubeVideoID(url) { // Returns with video id else returns false
|
||||||
|
|||||||
Reference in New Issue
Block a user