diff --git a/src/config.js b/src/config.js index a93ffe28..e57dcde2 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,6 @@ const CONFIG_KEY = 'ytaf-configuration'; const defaultConfig = { + hideLogo: false, enableAdBlock: true, enableSponsorBlock: true, enableSponsorBlockSponsor: true, diff --git a/src/ui.js b/src/ui.js index 4bce127e..a01bd529 100644 --- a/src/ui.js +++ b/src/ui.js @@ -47,6 +47,7 @@ uiContainer.addEventListener( uiContainer.innerHTML = `
@@ -62,6 +63,12 @@ uiContainer.innerHTML = ` document.querySelector('body').appendChild(uiContainer); +uiContainer.querySelector('#__hide_logo').checked = configRead('hideLogo'); +uiContainer.querySelector('#__hide_logo').addEventListener('change', (evt) => { + configWrite('hideLogo', evt.target.checked); + logoHideShow(); +}); + uiContainer.querySelector('#__adblock').checked = configRead('enableAdBlock'); uiContainer.querySelector('#__adblock').addEventListener('change', (evt) => { configWrite('enableAdBlock', evt.target.checked); @@ -190,6 +197,18 @@ export function showNotification(text, time = 3000) { }, time); } +// Hide youtube logo from the top right +function logoHideShow() { + document.querySelector('ytlr-redux-connect-ytlr-logo-entity').style.opacity = + configRead('hideLogo') ? '0' : '1'; +} + setTimeout(() => { showNotification('Press [GREEN] to open YTAF configuration screen'); + logoHideShow(); }, 2000); + +logoHideShow(); +setTimeout(() => { + logoHideShow(); +}, 4000);