From 762039e2f65225d1ae0726679fb152ad28a1b73c Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 14 Jul 2019 13:10:53 -0400 Subject: [PATCH] Fixed sponsor getting added each time a video was loaded even though it's already in the player. --- content.js | 5 +++++ 1 file changed, 5 insertions(+) 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";