diff --git a/content.js b/content.js index 9b2d472d..b165dafd 100644 --- a/content.js +++ b/content.js @@ -58,12 +58,6 @@ var lastSponsorTimeSkippedUUID = null; //if showing the start sponsor button or the end sponsor button on the player var showingStartSponsor = true; -//should the video controls buttons be added -//TODO: If invidious gets video controls, change the code where this is set from chrome.sync as well. -var hideVideoPlayerControls = onInvidious; -var hideInfoButtonPlayerControls = onInvidious; -var hideDeleteButtonPlayerControls = onInvidious; - //the sponsor times being prepared to be submitted var sponsorTimesSubmitting = []; @@ -653,7 +647,7 @@ async function updateVisibilityOfPlayerControlsButton() { await createButtons(); - if (SB.config.hideVideoPlayerControls) { + if (SB.config.hideVideoPlayerControls || onInvidious) { document.getElementById("startSponsorButton").style.display = "none"; document.getElementById("submitButton").style.display = "none"; } else { @@ -661,13 +655,13 @@ async function updateVisibilityOfPlayerControlsButton() { } //don't show the info button on embeds - if (SB.config.hideInfoButtonPlayerControls || document.URL.includes("/embed/")) { + if (SB.config.hideInfoButtonPlayerControls || document.URL.includes("/embed/") || onInvidious) { document.getElementById("infoButton").style.display = "none"; } else { document.getElementById("infoButton").style.removeProperty("display"); } - if (SB.config.hideDeleteButtonPlayerControls) { + if (SB.config.hideDeleteButtonPlayerControls || onInvidious) { document.getElementById("deleteButton").style.display = "none"; } } diff --git a/options/options.js b/options/options.js index 10abfe7a..82e398d1 100644 --- a/options/options.js +++ b/options/options.js @@ -126,8 +126,6 @@ function invidiousInstanceAddInit(element, option) { alert(chrome.i18n.getMessage("addInvidiousInstanceError")); } else { // Add this - //TODO Make the call to invidiousOnClick support passing the straight extra values, plus make the get not needed - //OR merge the config PR and use that let instanceList = SB.config[option]; if (!instanceList) instanceList = []; @@ -151,7 +149,8 @@ function invidiousInstanceAddInit(element, option) { let resetButton = element.querySelector(".invidious-instance-reset"); resetButton.addEventListener("click", function(e) { if (confirm(chrome.i18n.getMessage("resetInvidiousInstanceAlert"))) { - SB.config[option] = SB.defaults[option]; + // Set to a clone of the default + SB.config[option] = SB.defaults[option].slice(0); } }); } @@ -241,9 +240,9 @@ function invidiousOnClick(checkbox, option) { id: "invidious", conditions, actions: [new chrome.declarativeContent.RequestContentScript({ - allFrames: true, - js, - css + allFrames: true, + js, + css })] };