aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-07-14 13:10:53 -0400
committerAjay Ramachandran <[email protected]>2019-07-14 13:10:53 -0400
commit762039e2f65225d1ae0726679fb152ad28a1b73c (patch)
treebeec5016432f106e90ab9ac344170ac3391cb95b
parenta1d51656c50dd0288c1f915090fa0de54a3a49d5 (diff)
downloadSponsorBlock-762039e2f65225d1ae0726679fb152ad28a1b73c.tar.gz
SponsorBlock-762039e2f65225d1ae0726679fb152ad28a1b73c.zip
Fixed sponsor getting added each time a video was loaded even though it's already in the player.
-rw-r--r--content.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/content.js b/content.js
index d63b8fc5..f5b82b2c 100644
--- a/content.js
+++ b/content.js
@@ -166,6 +166,11 @@ function goBackToPreviousTime() {
//Adds a sponsorship starts button to the player controls
function addPlayerControlsButton() {
+ if (document.getElementById("startSponsorButton") != null) {
+ //it's already added
+ return;
+ }
+
let startSponsorButton = document.createElement("button");
startSponsorButton.id = "startSponsorButton";
startSponsorButton.className = "ytp-button";