diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index f8157d91..6b8f923f 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -440,6 +440,9 @@ "shortCheck": { "message": "The following submission is shorter than your minimum duration option. This could mean that this is already submitted, and just being ignored due to this option. Are you sure you would like to submit?" }, + "liveOrPremiere": { + "message": "Submitting on an active livesteam or premiere is not allowed. Please wait until it finishes, then refresh the page and verify that the segments are still valid." + }, "showUploadButton": { "message": "Show Upload Button" }, diff --git a/src/content.ts b/src/content.ts index 0d0aa132..37c3812a 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1798,6 +1798,12 @@ function submitSponsorTimes() { //send the message to the background js //called after all the checks have been made that it's okay to do so async function sendSubmitMessage() { + // Block if submitting on a running livestream or premiere + if (isVisible(document.querySelector(".ytp-live-badge"))) { + alert(chrome.i18n.getMessage("liveOrPremiere")); + return; + } + // Add loading animation playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker.svg"); const stopAnimation = AnimationUtils.applyLoadingAnimation(playerButtons.submit.button, 1, () => updateEditButtonsOnPlayer());