aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-07-12 16:50:26 -0400
committerAjay Ramachandran <[email protected]>2019-07-12 16:50:26 -0400
commitac2864a3ef3d95b6ed9b01b0ffba33668845f3f6 (patch)
tree32fa637f5b2839332a9971c5fe4d7d2e8447921a
parentf265ad9173ec6a943ffca0b762c6e1681571ff72 (diff)
downloadSponsorBlock-ac2864a3ef3d95b6ed9b01b0ffba33668845f3f6.tar.gz
SponsorBlock-ac2864a3ef3d95b6ed9b01b0ffba33668845f3f6.zip
Made popup toggle image of player control as well.
-rw-r--r--content.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/content.js b/content.js
index 891bb457..c872aa4d 100644
--- a/content.js
+++ b/content.js
@@ -154,6 +154,16 @@ function addPlayerControlsButton() {
addPlayerControlsButton();
function startSponsorClicked() {
+ toggleStartSponsorButton();
+
+ //send back current time with message
+ chrome.runtime.sendMessage({
+ message: "addSponsorTime",
+ time: v.currentTime
+ });
+}
+
+function toggleStartSponsorButton() {
if (showingStartSponsor) {
showingStartSponsor = false;
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker256px.png");
@@ -161,12 +171,6 @@ function startSponsorClicked() {
showingStartSponsor = true;
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
@@ -258,6 +262,9 @@ function sponsorMessageStarted() {
message: "time",
time: v.currentTime
});
+
+ //update button
+ toggleStartSponsorButton();
}
function getYouTubeVideoID(url) { // Returns with video id else returns false