Skip to content

Commit f4ae3a2

Browse files
committed
Fixes bug where videos had two event listeners
1 parent bdac5ae commit f4ae3a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/content.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const videoOverlay = document.getElementById("video-overlay");
2828
const video = document.getElementById("video");
2929
const skip = document.getElementById("skip-button");
3030

31+
var eventButtons = [];
32+
3133
var enabled = true;
3234
var assignments = true;
3335
var quizzes = false;
@@ -360,7 +362,8 @@ function isValidVideo(url) {
360362
}
361363

362364
function initButton(button, type) {
363-
if (button != null) {
365+
if (button != null && !eventButtons.includes(button)) {
366+
eventButtons.push(button);
364367
button.addEventListener("click", () => {
365368
displayBevo(type);
366369
});

0 commit comments

Comments
 (0)