@@ -86821,27 +86821,31 @@ function loadImage() {
86821
86821
86822
86822
mainVideo.addEventListener('loadeddata', function (event) {
86823
86823
var animControlsButton = document.getElementsByClassName("ytp-right-controls");
86824
- var button = document.createElement('button');
86825
- button.className = 'ytp-button it-player-button';
86826
- button.dataset.title = "PoseDream";
86827
86824
86828
- button.onclick = function () {
86829
- document.dispatchEvent(new CustomEvent('displayPoseDreamPopup', {
86830
- detail: {
86831
- animationID: 'skeleton'
86832
- }
86833
- }));
86834
- };
86825
+ if (document.getElementById("posedream-popup-btn") === null) {
86826
+ var button = document.createElement('button');
86827
+ button.id = "posedream-popup-btn";
86828
+ button.className = 'ytp-button it-player-button';
86829
+ button.dataset.title = "PoseDream";
86830
+
86831
+ button.onclick = function () {
86832
+ document.dispatchEvent(new CustomEvent('displayPoseDreamPopup', {
86833
+ detail: {
86834
+ animationID: 'skeleton'
86835
+ }
86836
+ }));
86837
+ };
86835
86838
86836
- animControlsButton[0].insertBefore(button, animControlsButton[0].childNodes[0]);
86837
- var playerImage = new Image();
86838
- playerImage.src = chrome.runtime.getURL("/images/logo48.png");
86839
+ animControlsButton[0].insertBefore(button, animControlsButton[0].childNodes[0]);
86840
+ var playerImage = new Image();
86841
+ playerImage.src = chrome.runtime.getURL("/images/logo48.png");
86839
86842
86840
- playerImage.onload = function () {
86841
- var imgTag = document.createElement('img');
86842
- imgTag.src = playerImage.src;
86843
- button.appendChild(imgTag);
86844
- };
86843
+ playerImage.onload = function () {
86844
+ var imgTag = document.createElement('img');
86845
+ imgTag.src = playerImage.src;
86846
+ button.appendChild(imgTag);
86847
+ };
86848
+ }
86845
86849
86846
86850
var div = document.createElement('div');
86847
86851
div.className = 'posedream-video-popup';
0 commit comments