From b7e7b4fc3888759ba2b659d5dd85ae5446217b52 Mon Sep 17 00:00:00 2001 From: DavG Date: Wed, 10 Aug 2022 15:36:59 +0200 Subject: [PATCH] Add option to hide youtube logo --- CHANGELOG.md | 6 ++++++ assets/appinfo.json | 2 +- package.json | 2 +- src/config.js | 3 ++- src/ui.js | 10 ++++++++++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6ea187f..5fa3977b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [0.3.2] - 2022/08/11 + +### Added + +- Option to hide YouTube logo (avoid OLED burning) + ## [0.3.1] - 2022/01/27 ### Fixed diff --git a/assets/appinfo.json b/assets/appinfo.json index b90d0d94..61cad195 100644 --- a/assets/appinfo.json +++ b/assets/appinfo.json @@ -1,6 +1,6 @@ { "id": "youtube.leanback.v4", - "version": "0.3.1", + "version": "0.3.2", "vendor": "My Company", "type": "web", "main": "index.html", diff --git a/package.json b/package.json index e7bf2707..90396882 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "youtube-webos", - "version": "0.3.1", + "version": "0.3.2", "description": "Youtube App without ADs", "main": "index.js", "scripts": { diff --git a/src/config.js b/src/config.js index a93ffe28..ae100814 100644 --- a/src/config.js +++ b/src/config.js @@ -7,7 +7,8 @@ const defaultConfig = { enableSponsorBlockOutro: true, enableSponsorBlockInteraction: true, enableSponsorBlockSelfPromo: true, - enableSponsorBlockMusicOfftopic: true + enableSponsorBlockMusicOfftopic: true, + hideLogo: false }; let localConfig; diff --git a/src/ui.js b/src/ui.js index 4bce127e..7b73c6ac 100644 --- a/src/ui.js +++ b/src/ui.js @@ -58,6 +58,7 @@ uiContainer.innerHTML = `
Sponsor segments skipping - https://sponsor.ajay.app
+ `; document.querySelector('body').appendChild(uiContainer); @@ -128,6 +129,11 @@ uiContainer configWrite('enableSponsorBlockMusicOfftopic', evt.target.checked); }); +uiContainer.querySelector('#__hide_logo').checked = configRead('hideLogo'); +uiContainer.querySelector('#__hide_logo').addEventListener('change', (evt) => { + configWrite('hideLogo', evt.target.checked); +}); + const eventHandler = (evt) => { console.info( 'Key event:', @@ -193,3 +199,7 @@ export function showNotification(text, time = 3000) { setTimeout(() => { showNotification('Press [GREEN] to open YTAF configuration screen'); }, 2000); + +window.addEventListener("DOMNodeInserted", (evt) => { + document.querySelector("ytlr-logo-entity").style.visibility = configRead('hideLogo') ? 'hidden' : 'visible'; +}, false);