Skip to content

Commit

Permalink
Add option to hide youtube logo
Browse files Browse the repository at this point in the history
  • Loading branch information
DavG committed Aug 10, 2022
1 parent af2098e commit b7e7b4f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion assets/appinfo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "youtube.leanback.v4",
"version": "0.3.1",
"version": "0.3.2",
"vendor": "My Company",
"type": "web",
"main": "index.html",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youtube-webos",
"version": "0.3.1",
"version": "0.3.2",
"description": "Youtube App without ADs",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const defaultConfig = {
enableSponsorBlockOutro: true,
enableSponsorBlockInteraction: true,
enableSponsorBlockSelfPromo: true,
enableSponsorBlockMusicOfftopic: true
enableSponsorBlockMusicOfftopic: true,
hideLogo: false
};

let localConfig;
Expand Down
10 changes: 10 additions & 0 deletions src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ uiContainer.innerHTML = `
<label for="__sponsorblock_music_offtopic"><input type="checkbox" id="__sponsorblock_music_offtopic" /> Skip Music and Off-topic Segments</label>
</blockquote>
<div><small>Sponsor segments skipping - https://sponsor.ajay.app</small></div>
<label for="__hide_logo"><input type="checkbox" id="__hide_logo" /> Hide YouTube logo (recommended on OLEDs)</label>
`;

document.querySelector('body').appendChild(uiContainer);
Expand Down Expand Up @@ -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:',
Expand Down Expand Up @@ -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);

0 comments on commit b7e7b4f

Please sign in to comment.