From 550f4129b45ea811bc155ff9fd33908d3994bed4 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 7 Mar 2024 16:55:53 +0100 Subject: [PATCH 01/94] Update styles.css cosmetic/ comment phrasing --- js&css/extension/www.youtube.com/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index 2c58d1fca..dcf62bcfd 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -454,7 +454,7 @@ ytd-guide-section-renderer .it-button::after { /*------------------------------------------------------------------------------ -9.0 BLACKLIST +9.0 BLOCKLIST ------------------------------------------------------------------------------*/ .it-add-to-blocklist { position: absolute; From 0745880c7edf82698c49936b427b2260f2899ef9 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 12 Mar 2024 10:53:56 +0100 Subject: [PATCH 02/94] Update styles.css separate .it-blocklisted-channel --- js&css/extension/www.youtube.com/styles.css | 76 ++++++++++++++------- 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index dcf62bcfd..e126a5316 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -1,7 +1,7 @@ /* fix for youtube's player moving in from the right side */ html {overflow-x: hidden !important} /* html {overflow-x: hidden !important} -/* Fix to tame Youtube's page-load / make it more calm - the player wont annoyingly slide in from the right anymore */ +/* Fix to tame Youtube's page-load / make it more calm - the player wont annoyingly slide in from the right anymore */ /* previously also: html[it-transcript='true'] {overflow-x: hidden !important}*/ @-moz-document url-prefix() {overflow-x: visible !important} /* REMOVE ME SOON https://github.com/code-charity/youtube/issues/1649 */ @@ -11,7 +11,7 @@ html {overflow-x: hidden !important} html[it-pathname*="/shorts/"] #content.style-scope ytd-engagement-panel-title-header-renderer { max-width: 42vw !important; } - /* or maybe something like : html[it-pathname*="/shorts/"] #header.style-scope ytd-engagement-panel-title-header-renderer "visibility-button" */ + /* or maybe something like : html[it-pathname*="/shorts/"] #header.style-scope ytd-engagement-panel-title-header-renderer "visibility-button" */ } /*------------------------------------------------------------------------------ @@ -57,27 +57,27 @@ html[it-ads=subscribed_channels] #related #player-ads, html[it-ads=subscribed_channels] #masthead-ad, html[it-ads=subscribed_channels] *[target-id*='engagement-panel-ads'], html[it-ads=subscribed_channels] .ytd-ad-slot-renderer, -html[it-ads=subscribed_channels] yt-mealbar-promo-renderer, -html[it-ads=subscribed_channels] #player .ytp-ad-image-overlay, +html[it-ads=subscribed_channels] yt-mealbar-promo-renderer, +html[it-ads=subscribed_channels] #player .ytp-ad-image-overlay, html[it-ads=subscribed_channels] #player .video-ads .ytp-ad-player-overlay-flyout-cta, html[it-ads=subscribed_channels] #player .ytp-ad-module .ytp-ad-player-overlay-flyout-cta, html[it-ads=block_all] #related #player-ads, html[it-ads=block_all] #masthead-ad, html[it-ads=block_all] *[target-id*='engagement-panel-ads'], -html[it-ads=block_all] .ytd-ad-slot-renderer, +html[it-ads=block_all] .ytd-ad-slot-renderer, html[it-ads=block_all] yt-mealbar-promo-renderer, html[it-ads=block_all] #player .ytp-ad-image-overlay, -html[it-ads=block_all] #player .video-ads .ytp-ad-player-overlay-flyout-cta, +html[it-ads=block_all] #player .video-ads .ytp-ad-player-overlay-flyout-cta, html[it-ads=block_all] #player .ytp-ad-module .ytp-ad-player-overlay-flyout-cta{ display: none !important; } /* -html[it-ads=subscribed_channels] #player .video-ads, -html[it-ads=subscribed_channels] #player .ytp-ad-module, -html[it-ads=block_all] #player .video-ads, +html[it-ads=subscribed_channels] #player .video-ads, +html[it-ads=subscribed_channels] #player .ytp-ad-module, +html[it-ads=block_all] #player .video-ads, html[it-ads=block_all] #player .ytp-ad-module { - opacity: 0.0001 !important; + opacity: 0.0001 !important; } html[it-ads=subscribed_channels] #player .ytp-ad-preview-image, @@ -194,7 +194,7 @@ html[it-mini-player-cursor='nw-resize']::after { /*------------------------------------------------------------------------------ -# +# ------------------------------------------------------------------------------*/ html[data-page-type='video'][it-player-fit-to-win-button='true'] .ytp-right-controls { display: flex; @@ -479,7 +479,7 @@ ytd-guide-section-renderer .it-button::after { align-items: center; content: 'Blocklist'; text-transform: uppercase; - color: white; /*quick-fix for: var(--yt-spec-icon-active-other, #fff);*/ + color: white; /*quick-fix for: var(--yt-spec-icon-active-other, #fff);*/ position: absolute; left: 100%; top: 0; @@ -530,25 +530,51 @@ ytd-guide-section-renderer .it-button::after { *:hover>.it-add-to-blocklist { visibility: visible; } -.it-blocklisted-video { + +.it-blocklisted-video .it-add-to-blocklist svg, +.it-blocklisted-channel .it-add-to-blocklist svg { + fill: green; +} + +.it-blocklisted-video .it-add-to-blocklist::after, +.it-blocklisted-channel .it-add-to-blocklist::after { + color: green; +} + +.it-blocklisted-video .it-add-to-blocklist::after { + content: "Unblock Video"; +} + +.it-blocklisted-channel .it-add-to-blocklist::after { + content: "Unblock Channel"!important; +} + +.it-blocklisted-video, +.it-blocklisted-channel { opacity: .15; - max-height: 19px; + max-height: 4rem; overflow: hidden; margin-top: -5px !important; transition: max-height 0.4s ease 0.1s; } -.it-blocklisted-video ytd-thumbnail { + +.it-blocklisted-video ytd-thumbnail, +.it-blocklisted-channel ytd-thumbnail { visibility: hidden; max-width: 0; transition: max-width 0.4s ease 0.1s; } -.it-blocklisted-video:hover { + +.it-blocklisted-video:hover, +.it-blocklisted-channel:hover { opacity: 1; overflow: visible; max-height: 120px; transition: max-height 0.4s ease 1.1s; } -.it-blocklisted-video:hover ytd-thumbnail { + +.it-blocklisted-video:hover ytd-thumbnail, +.it-blocklisted-channel:hover ytd-thumbnail { visibility: visible; max-width: 220px; transition: max-width 0.4s ease 1.1s; @@ -556,9 +582,9 @@ ytd-guide-section-renderer .it-button::after { margin-bottom: 4px !important; margin-left: 5px !important; } -/* .it-blocklisted-video #metadata-line {display:none !important} - .it-blocklisted-video div {display: inline-block !important} */ - +/* .it-blocklisted-video #metadata-line {display:none !important} + .it-blocklisted-video div {display: inline-block !important} */ + /*------------NEW---------------*/ .improvedtube-sidebar-a { @@ -633,7 +659,7 @@ ytd-guide-section-renderer .it-button::after { 3.0 THEMES ------------------------------------------------------------------------------*/ /*update: cinematics */ -html[it-theme=black] #cinematics, +html[it-theme=black] #cinematics, html[it-theme=desert] #cinematics {display:none !important} html[it-theme=dawn] #cinematics, html[it-theme=sunset] #cinematics, @@ -641,7 +667,7 @@ html[it-theme=night] #cinematics {mix-blend-mode: lighten !important} html[it-theme=plain] #cinematics {filter:invert(100%) !important; mix-blend-mode: darken !important} /*video detail text color. Fix. Themes didnt apply video description text color*/ -html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} +html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string__link--call-to-action-color {color: var(--yt-spec-call-to-action)} /*The next two lines below can be removed if exact theming consistency isn't the goal and we just want to keep it simple.*/ html[it-theme]:not([it-theme=default]):not([it-theme=dark]) a.yt-simple-endpoint.yt-formatted-string {color: var(--yt-spec-call-to-action) !important} @@ -881,7 +907,7 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } /*DAWN*/ - + html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark], html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] { @@ -1115,7 +1141,7 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference --yt-lightsource-secondary-title-color: var(--yt-spec-text-secondary) !important; } -/*DESERT*/ +/*DESERT*/ html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark], @@ -1798,7 +1824,7 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc /*SUNSET*/ - + html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark], html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] { From 3631b80bda0d4125489619b9dd8f8e2cc868a870 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 04:55:52 +0100 Subject: [PATCH 03/94] Update styles.css aligned thumbnails, visible text in grid views --- js&css/extension/www.youtube.com/styles.css | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index e126a5316..dfad496be 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -554,10 +554,16 @@ ytd-guide-section-renderer .it-button::after { opacity: .15; max-height: 4rem; overflow: hidden; - margin-top: -5px !important; transition: max-height 0.4s ease 0.1s; } +ytd-grid-video-renderer .it-blocklisted-video, +ytd-grid-video-renderer .it-blocklisted-channel, +ytd-rich-grid-media .it-blocklisted-video, +ytd-rich-grid-media .it-blocklisted-channel { + overflow: visible; +} + .it-blocklisted-video ytd-thumbnail, .it-blocklisted-channel ytd-thumbnail { visibility: hidden; @@ -578,9 +584,6 @@ ytd-guide-section-renderer .it-button::after { visibility: visible; max-width: 220px; transition: max-width 0.4s ease 1.1s; - margin-top: -7px !important; - margin-bottom: 4px !important; - margin-left: 5px !important; } /* .it-blocklisted-video #metadata-line {display:none !important} .it-blocklisted-video div {display: inline-block !important} */ From ba3e08bdbcbadde6ff87f0d85e77e58878bd9ab3 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 06:43:47 +0100 Subject: [PATCH 04/94] Update functions.js updated blocklist --- js&css/web-accessible/functions.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index e3b30fefb..be893a83a 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -19,12 +19,9 @@ ImprovedTube.ytElementsHandler = function (node) { if (node.href) { this.channelDefaultTab(node); - if (node.className.indexOf('ytd-thumbnail') !== -1) { + if (this.storage.blocklist_activate && node.classList.contains('ytd-thumbnail')) { this.blocklist('video', node); } - if (node.href.match(/@|((channel|user|c)\/)([^/]+)/)) { - this.blocklist('channel', node); - } } } /* else if (name === 'META') { // infos are not updated when clicking related videos... if(node.getAttribute('name')) { @@ -118,8 +115,8 @@ ImprovedTube.ytElementsHandler = function (node) { } else if (name === 'YTD-PLAYLIST-HEADER-RENDERER' || (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-playlist-panel-renderer'))) { this.playlistPopupUpdate(); } else if (name === 'YTD-SUBSCRIBE-BUTTON-RENDERER') { - if (node.className.indexOf('ytd-c4-tabbed-header-renderer') !== -1) { - ImprovedTube.blocklist('channel', node); + if (this.storage.blocklist_activate && node.classList.contains('ytd-c4-tabbed-header-renderer')) { + ImprovedTube.blocklist('channel', node); } ImprovedTube.elements.subscribe_button = node; From 6867d394ec02c065da6452b45b01a5a7dfd9ec34 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 07:40:14 +0100 Subject: [PATCH 05/94] Update functions.js formatting, structure --- js&css/web-accessible/functions.js | 590 +++++++++++++++-------------- 1 file changed, 298 insertions(+), 292 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index be893a83a..6276c8325 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -1,257 +1,258 @@ /*-------------------------------------------------------------- >>> FUNCTIONS --------------------------------------------------------------*/ -const DOM_filter = /^(SCRIPT|DOM-IF|DOM-REPEAT|svg|SPAN||#text|#comment|yt-icon-shape|iron-iconset-svg)$/; +const DOM_filter = /^(SCRIPT|DOM-IF|DOM-REPEAT|svg|SPAN||#text|#comment|yt-icon-shape|iron-iconset-svg)$/; ImprovedTube.childHandler = function (node) { //console.log(node.nodeName); -if (DOM_filter.test(node.nodeName)) {return; } -ImprovedTube.ytElementsHandler(node); - var children = node.children; - if (children) { let i = 0; for (const child of children) {ImprovedTube.childHandler(children[i]); -//console.log("node.nodeName:CHILD-"+i+":"+children[i].id+",class:"+children[i].className+","+children[i]+"("+children[i].nodeName+")"); - i++;} - } + if (DOM_filter.test(node.nodeName)) { return; } + ImprovedTube.ytElementsHandler(node); + for (const child of node.children) { + ImprovedTube.childHandler(child); + } }; + ImprovedTube.ytElementsHandler = function (node) { - var name = node.nodeName, - id = node.id; + let id = node.id; - if (name === 'A') { - if (node.href) { - this.channelDefaultTab(node); + switch(node.nodeName) { + case 'A': + if (node.href) { + this.channelDefaultTab(node); - if (this.storage.blocklist_activate && node.classList.contains('ytd-thumbnail')) { - this.blocklist('video', node); + if (this.storage.blocklist_activate && node.classList.contains('ytd-thumbnail')) { + this.blocklist('video', node); + } } - } - } /* else if (name === 'META') { // infos are not updated when clicking related videos... - if(node.getAttribute('name')) { - //if(node.getAttribute('name') === 'title') {ImprovedTube.title = node.content;} //duplicate - //if(node.getAttribute('name') === 'description') {ImprovedTube.description = node.content;} //duplicate - //if node.getAttribute('name') === 'themeColor') {ImprovedTube.themeColor = node.content;} //might help our darkmode/themes + break; + /* var name = node.nodeName, + id = node.id; + else if (name === 'META') { // infos are not updated when clicking related videos... + if(node.getAttribute('name')) { + //if(node.getAttribute('name') === 'title') {ImprovedTube.title = node.content;} //duplicate + //if(node.getAttribute('name') === 'description') {ImprovedTube.description = node.content;} //duplicate + //if node.getAttribute('name') === 'themeColor') {ImprovedTube.themeColor = node.content;} //might help our darkmode/themes //Do we need any of these here before the player starts? - //if(node.getAttribute('name') === 'keywords') {ImprovedTube.keywords = node.content;} - } else if (node.getAttribute('itemprop')) { - //if(node.getAttribute('itemprop') === 'name') {ImprovedTube.title = node.content;} - if(node.getAttribute('itemprop') === 'genre') {ImprovedTube.category = node.content;} - //if(node.getAttribute('itemprop') === 'channelId') {ImprovedTube.channelId = node.content;} - //if(node.getAttribute('itemprop') === 'videoId') {ImprovedTube.videoId = node.content;} + //if(node.getAttribute('name') === 'keywords') {ImprovedTube.keywords = node.content;} + } else if (node.getAttribute('itemprop')) { + //if(node.getAttribute('itemprop') === 'name') {ImprovedTube.title = node.content;} + if(node.getAttribute('itemprop') === 'genre') {ImprovedTube.category = node.content;} + //if(node.getAttribute('itemprop') === 'channelId') {ImprovedTube.channelId = node.content;} + //if(node.getAttribute('itemprop') === 'videoId') {ImprovedTube.videoId = node.content;} //The following infos will enable awesome, smart features. Some of which everyone should use. - //if(node.getAttribute('itemprop') === 'description') {ImprovedTube.description = node.content;} - //if(node.getAttribute('itemprop') === 'duration') {ImprovedTube.duration = node.content;} - //if(node.getAttribute('itemprop') === 'interactionCount'){ImprovedTube.views = node.content;} - //if(node.getAttribute('itemprop') === 'isFamilyFriendly'){ImprovedTube.isFamilyFriendly = node.content;} - //if(node.getAttribute('itemprop') === 'unlisted') {ImprovedTube.unlisted = node.content;} - //if(node.getAttribute('itemprop') === 'regionsAllowed'){ImprovedTube.regionsAllowed = node.content;} - //if(node.getAttribute('itemprop') === 'paid') {ImprovedTube.paid = node.content;} - // if(node.getAttribute('itemprop') === 'datePublished' ){ImprovedTube.datePublished = node.content;} - //to use in the "how long ago"-feature, not to fail without API key? just like the "day-of-week"-feature above - // if(node.getAttribute('itemprop') === 'uploadDate') {ImprovedTube.uploadDate = node.content;} - } - } */ - else if (name === 'YTD-TOGGLE-BUTTON-RENDERER' || name === 'YTD-PLAYLIST-LOOP-BUTTON-RENDERER') { - if ( -//can be precise previously node.parentComponent & node.parentComponent.parentComponent - node.closest("YTD-MENU-RENDERER") && - node.closest("YTD-PLAYLIST-PANEL-RENDERER") - ) { var index = Array.prototype.indexOf.call(node.parentNode.children, node); - if (index === 0) { - if (this.storage.playlist_reverse === true) { -//can be precise: - try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode;} - catch{try{this.elements.playlist.actions = node;}catch{}} - } - } - } + //if(node.getAttribute('itemprop') === 'description') {ImprovedTube.description = node.content;} + //if(node.getAttribute('itemprop') === 'duration') {ImprovedTube.duration = node.content;} + //if(node.getAttribute('itemprop') === 'interactionCount'){ImprovedTube.views = node.content;} + //if(node.getAttribute('itemprop') === 'isFamilyFriendly'){ImprovedTube.isFamilyFriendly = node.content;} + //if(node.getAttribute('itemprop') === 'unlisted') {ImprovedTube.unlisted = node.content;} + //if(node.getAttribute('itemprop') === 'regionsAllowed'){ImprovedTube.regionsAllowed = node.content;} + //if(node.getAttribute('itemprop') === 'paid') {ImprovedTube.paid = node.content;} + // if(node.getAttribute('itemprop') === 'datePublished' ){ImprovedTube.datePublished = node.content;} + //to use in the "how long ago"-feature, not to fail without API key? just like the "day-of-week"-feature above + // if(node.getAttribute('itemprop') === 'uploadDate') {ImprovedTube.uploadDate = node.content;} + } + } */ + /* else if (name === 'TP-YT-PAPER-BUTTON') { + if ( (id === 'expand-sizer' || id === 'expand') && node.parentNode.id === 'description-inline-expander') { + setTimeout(function () { + ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY") + }, 750); + }} */ + case 'YTD-TOGGLE-BUTTON-RENDERER': + case 'YTD-PLAYLIST-LOOP-BUTTON-RENDERER': + //can be precise previously node.parentComponent & node.parentComponent.parentComponent + if (node.closest("YTD-MENU-RENDERER") && node.closest("YTD-PLAYLIST-PANEL-RENDERER")) { + var index = Array.prototype.indexOf.call(node.parentNode.children, node); + if (index === 0) { + if (this.storage.playlist_reverse === true) { + //can be precise: + try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode;} + catch{try{this.elements.playlist.actions = node;}catch{}} + } + } + } } - this.playlistReverse(); - } else if (index === 1) { - this.elements.playlist.shuffle_button = node; - - this.playlistShuffle(); - - if (this.storage.playlist_reverse === true) { -//can be precise: - try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode;} - catch{try{this.elements.playlist.actions = node;}catch{}} - } - } - } + this.playlistReverse(); + } else if (index === 1) { + this.elements.playlist.shuffle_button = node; + + this.playlistShuffle(); + + if (this.storage.playlist_reverse === true) { + //can be precise: + try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode;} + catch{try{this.elements.playlist.actions = node;}catch{}} + } + } + } } - this.playlistReverse(); + this.playlistReverse(); + } } - } - this.playlistPopupUpdate(); - } else if (name === 'YTD-GUIDE-SECTION-RENDERER') { - if (!this.elements.sidebar_section) { - this.elements.sidebar_section = node; + this.playlistPopupUpdate(); + break; + case 'YTD-GUIDE-SECTION-RENDERER': + if (!this.elements.sidebar_section) { + this.elements.sidebar_section = node; - this.improvedtubeYoutubeIcon(); - } - } else if (name === 'YTD-VIDEO-PRIMARY-INFO-RENDERER') { - this.elements.video_title = node.querySelector('.title.ytd-video-primary-info-renderer'); - - this.improvedtubeYoutubeIcon(); - this.improvedtubeYoutubeButtonsUnderPlayer(); - - - } else if (name === 'YTD-VIDEO-SECONDARY-INFO-RENDERER') { - this.elements.yt_channel_name = node.querySelector('ytd-channel-name'); - this.elements.yt_channel_link = node.querySelector('ytd-channel-name a'); - - if (document.documentElement.dataset.pageType === 'video') { - this.howLongAgoTheVideoWasUploaded(); - this.channelVideosCount(); - } - } else if (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-video-primary-info-renderer')) { - if(document.documentElement.dataset.pageType === 'video'){ - this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); - } - } else if (name === 'YTD-PLAYLIST-HEADER-RENDERER' || (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-playlist-panel-renderer'))) { - this.playlistPopupUpdate(); - } else if (name === 'YTD-SUBSCRIBE-BUTTON-RENDERER') { - if (this.storage.blocklist_activate && node.classList.contains('ytd-c4-tabbed-header-renderer')) { - ImprovedTube.blocklist('channel', node); - } - - ImprovedTube.elements.subscribe_button = node; - } else if (id === 'show-hide-button') { - this.elements.livechat.button = document.querySelector('[aria-label="Hide chat"]'); - // console.log(document.querySelector('[aria-label="Hide chat"]')) - this.livechat(); - } else if (name === 'YTD-MASTHEAD') { - if (!this.elements.masthead) { - this.elements.masthead = { - start: node.querySelector('#start'), - end: node.querySelector('#end'), - logo: node.querySelector('a#logo') - }; - - this.improvedtubeYoutubeIcon(); - } - } - else if (name === 'TP-YT-APP-DRAWER') { - if (!this.elements.app_drawer) { - this.elements.app_drawer = { - start: node.querySelector('div#header'), - logo: node.querySelector('a#logo') - }; + this.improvedtubeYoutubeIcon(); + } + break; + case 'YTD-VIDEO-PRIMARY-INFO-RENDERER': + this.elements.video_title = node.querySelector('.title.ytd-video-primary-info-renderer'); this.improvedtubeYoutubeIcon(); - } - } else if (name === 'YTD-PLAYER') { - if (!this.elements.ytd_player) { - ImprovedTube.elements.ytd_player = node; - } - } else if (id === 'movie_player') { - if (!this.elements.player) { - ImprovedTube.elements.player = node; - // if (this.storage.player_autoplay === false) { ImprovedTube.elements.player.stopVideo(); } - ImprovedTube.elements.video = node.querySelector('video'); - ImprovedTube.elements.player_left_controls = node.querySelector('.ytp-left-controls'); - ImprovedTube.elements.player_right_controls = node.querySelector('.ytp-right-controls'); - ImprovedTube.elements.player_thumbnail = node.querySelector('.ytp-cued-thumbnail-overlay-image'); - ImprovedTube.elements.player_subtitles_button = node.querySelector('.ytp-subtitles-button'); - ImprovedTube.playerSize(); - if ( typeof this.storage.ads !== 'undefined' && this.storage.ads !== "all_videos" ) { - new MutationObserver(function (mutationList) { - for (var i = 0, l = mutationList.length; i < l; i++) { - var mutation = mutationList[i]; - - if (mutation.type === 'childList') { - for (var j = 0, k = mutation.addedNodes.length; j < k; j++) { - var node = mutation.addedNodes[j]; - - if (node instanceof Element - && node.querySelector('ytp-ad-player-overlay, .ytp-ad-text, .ytp-ad-overlay-close-container, ytd-button-renderer#dismiss-button, *[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button.ytp-button, .ytp-ad-skip-button-modern.ytp-button') !== null - ){ImprovedTube.playerAds(node);} - } - } - if (mutation.type === 'attributes' && mutation.attributeName === 'id' && mutation.target.querySelector('*[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button-modern.ytp-button',) ) - {ImprovedTube.playerAds(node);} - } - }).observe(node, { - // attributes: true, - childList: true, - subtree: true - }); + this.improvedtubeYoutubeButtonsUnderPlayer(); + break; + case 'YTD-VIDEO-SECONDARY-INFO-RENDERER': + this.elements.yt_channel_name = node.querySelector('ytd-channel-name'); + this.elements.yt_channel_link = node.querySelector('ytd-channel-name a'); + + if (document.documentElement.dataset.pageType === 'video') { + this.howLongAgoTheVideoWasUploaded(); + this.channelVideosCount(); } - - new MutationObserver(function (mutationList) { - for (var i = 0, l = mutationList.length; i < l; i++) { - var mutation = mutationList[i]; - - if (mutation.type === 'attributes') { - if (mutation.attributeName === 'style') { - ImprovedTube.playerHdThumbnail(); + break; + case 'YTD-MENU-RENDERER': + case 'ytd-video-primary-info-renderer': + if (document.documentElement.dataset.pageType === 'video') { + this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); + } + break; + case 'YTD-MENU-RENDERER': + if (!node.classList.contains('ytd-playlist-panel-renderer')) break; + /* FALLTHROUGH */ + case 'YTD-PLAYLIST-HEADER-RENDERER': + this.playlistPopupUpdate(); + break; + case 'YTD-SUBSCRIBE-BUTTON-RENDERER': + if (this.storage.blocklist_activate && node.classList.contains('ytd-c4-tabbed-header-renderer')) { + ImprovedTube.blocklist('channel', node); + } + ImprovedTube.elements.subscribe_button = node; + break; + case 'YTD-MASTHEAD': + if (!this.elements.masthead) { + this.elements.masthead = {start: node.querySelector('#start'), + end: node.querySelector('#end'), + logo: node.querySelector('a#logo') + }; + + this.improvedtubeYoutubeIcon(); + } + break; + case 'TP-YT-APP-DRAWER': + if (!this.elements.app_drawer) { + this.elements.app_drawer = {start: node.querySelector('div#header'), + logo: node.querySelector('a#logo') + }; + + this.improvedtubeYoutubeIcon(); + } + break; + case 'YTD-PLAYER': + if (!this.elements.ytd_player) { + ImprovedTube.elements.ytd_player = node; + } + break; + case 'YTD-WATCH-FLEXY': + this.elements.ytd_watch = node; + + if (this.isset(this.storage.player_size) && this.storage.player_size !== 'do_not_change') { + node.calculateCurrentPlayerSize_ = function () { + if (!this.theater && ImprovedTube.elements.player) { + if (this.updateStyles) { + this.updateStyles({'--ytd-watch-flexy-width-ratio': 1, + '--ytd-watch-flexy-height-ratio': 0.5625}); + + this.updateStyles({'--ytd-watch-width-ratio': 1, + '--ytd-watch-height-ratio': 0.5625}); } + return {width: ImprovedTube.elements.player.offsetWidth, + height: Math.round(ImprovedTube.elements.player.offsetWidth / (16 / 9))} } + return {width: NaN, // ?? + height: NaN} } - }).observe(ImprovedTube.elements.player_thumbnail, { - attributes: true, - attributeFilter: ['style'], - childList: false, - subtree: false - }); - } - } else if (name === 'YTD-WATCH-FLEXY') { - this.elements.ytd_watch = node; - - if ( - this.isset(this.storage.player_size) && - this.storage.player_size !== 'do_not_change' - ) { - node.calculateCurrentPlayerSize_ = function () { - if (!this.theater && ImprovedTube.elements.player) { - if (this.updateStyles) { - this.updateStyles({ - '--ytd-watch-flexy-width-ratio': 1, - '--ytd-watch-flexy-height-ratio': 0.5625 - }); - - this.updateStyles({ - '--ytd-watch-width-ratio': 1, - '--ytd-watch-height-ratio': 0.5625 - }); + node.calculateNormalPlayerSize_ = node.calculateCurrentPlayerSize_; // ?? + } + break; + default: + if (id) { + if (id === 'show-hide-button') { + this.elements.livechat.button = document.querySelector('[aria-label="Hide chat"]'); + // console.log(document.querySelector('[aria-label="Hide chat"]')) + this.livechat(); + } else if (id === 'movie_player') { + if (!this.elements.player) { + ImprovedTube.elements.player = node; + // if (this.storage.player_autoplay === false) { ImprovedTube.elements.player.stopVideo(); } + ImprovedTube.elements.video = node.querySelector('video'); + ImprovedTube.elements.player_left_controls = node.querySelector('.ytp-left-controls'); + ImprovedTube.elements.player_right_controls = node.querySelector('.ytp-right-controls'); + ImprovedTube.elements.player_thumbnail = node.querySelector('.ytp-cued-thumbnail-overlay-image'); + ImprovedTube.elements.player_subtitles_button = node.querySelector('.ytp-subtitles-button'); + ImprovedTube.playerSize(); + if (typeof this.storage.ads !== 'undefined' && this.storage.ads !== "all_videos") { + new MutationObserver(function (mutationList) { + for (var i = 0, l = mutationList.length; i < l; i++) { + var mutation = mutationList[i]; + + if (mutation.type === 'childList') { + for (var j = 0, k = mutation.addedNodes.length; j < k; j++) { + var node = mutation.addedNodes[j]; + + if (node instanceof Element + && node.querySelector('ytp-ad-player-overlay, .ytp-ad-text, .ytp-ad-overlay-close-container, ytd-button-renderer#dismiss-button, *[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button.ytp-button, .ytp-ad-skip-button-modern.ytp-button') !== null) { + ImprovedTube.playerAds(node); + } + } + } + if (mutation.type === 'attributes' && mutation.attributeName === 'id' && mutation.target.querySelector('*[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button-modern.ytp-button',)){ + ImprovedTube.playerAds(node); + } + } + }).observe(node, {childList: true, // attributes: true, + subtree: true + }); + } + + new MutationObserver(function (mutationList) { + for (var i = 0, l = mutationList.length; i < l; i++) { + var mutation = mutationList[i]; + + if (mutation.type === 'attributes') { + if (mutation.attributeName === 'style') { + ImprovedTube.playerHdThumbnail(); + } + } + } + }).observe(ImprovedTube.elements.player_thumbnail, {attributes: true, + attributeFilter: ['style'], + childList: false, + subtree: false + }); } - - return { - width: ImprovedTube.elements.player.offsetWidth, - height: Math.round(ImprovedTube.elements.player.offsetWidth / (16 / 9)) - }; + } else if (document.documentElement.dataset.pageType === 'video') { + if (id === 'description-inline-expander' || id === 'description-inner') { + setTimeout(function () {ImprovedTube.expandDescription(node);}, 300); + } else if (id === 'meta') {setTimeout(function () {ImprovedTube.expandDescription(node.querySelector('#more'));}, 200); + } else if (id === 'below') { + setTimeout(function () {}, 0); + } else if (id === 'panels') { + setTimeout(function () { + ImprovedTube.transcript(node); + ImprovedTube.chapters(node); + }, 200); + } } - - return { - width: NaN, // ?? - height: NaN - }; - }; - - node.calculateNormalPlayerSize_ = node.calculateCurrentPlayerSize_; // ?? - } - }else if (document.documentElement.dataset.pageType === 'video'){ - if (id === 'description-inline-expander' || id === 'description-inner') { - setTimeout(function () { - ImprovedTube.expandDescription(node); - }, 300); - } else if (id === 'meta') {setTimeout(function () {ImprovedTube.expandDescription(node.querySelector('#more'));}, 200); - } else if (id === 'below' ){setTimeout(function () { }, 0); - } else if (id === 'panels'){setTimeout(function () { - ImprovedTube.transcript(node); - ImprovedTube.chapters(node);}, 200); - } /* else if (name === 'TP-YT-PAPER-BUTTON') { - if ( (id === 'expand-sizer' || id === 'expand') && node.parentNode.id === 'description-inline-expander') { - setTimeout(function () { - ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY") - }, 750); - }} */ - } - + } + break; + } }; ImprovedTube.pageType = function () { @@ -278,12 +279,11 @@ ImprovedTube.videoPageUpdate = function () { var video_id = this.getParam(new URL(location.href).search.substr(1), 'v'); if (this.storage.track_watched_videos === true && video_id) { - ImprovedTube.messages.send({ - action: 'watched', - type: 'add', - id: video_id, - title: document.title - }); + ImprovedTube.messages.send({action: 'watched', + type: 'add', + id: video_id, + title: document.title + }); } this.initialVideoUpdateDone = true; @@ -293,8 +293,8 @@ ImprovedTube.videoPageUpdate = function () { ImprovedTube.channelVideosCount(); ImprovedTube.upNextAutoplay(); ImprovedTube.playerAutofullscreen(); - ImprovedTube.playerSize(); - if( this.storage.player_always_repeat === true) {ImprovedTube.playerRepeat();}; + ImprovedTube.playerSize(); + if (this.storage.player_always_repeat === true) { ImprovedTube.playerRepeat(); }; ImprovedTube.playerScreenshotButton(); ImprovedTube.playerRepeatButton(); ImprovedTube.playerRotateButton(); @@ -351,7 +351,7 @@ ImprovedTube.initPlayer = function () { ImprovedTube.subtitlesBackgroundOpacity(); ImprovedTube.playerQuality(); ImprovedTube.playerVolume(); - if(this.storage.player_always_repeat === true) {ImprovedTube.playerRepeat();}; + if (this.storage.player_always_repeat === true) { ImprovedTube.playerRepeat(); } ImprovedTube.playerScreenshotButton(); ImprovedTube.playerRepeatButton(); ImprovedTube.playerRotateButton(); @@ -360,8 +360,8 @@ ImprovedTube.initPlayer = function () { ImprovedTube.playerHamburgerButton(); ImprovedTube.playerControls(); ImprovedTube.expandDescription(); - setTimeout(function () { ImprovedTube.forcedTheaterMode(); }, 150); - if (location.href.indexOf('/embed/') === -1) { ImprovedTube.miniPlayer(); } + setTimeout(function () {ImprovedTube.forcedTheaterMode();}, 150); + if (location.href.indexOf('/embed/') === -1) { ImprovedTube.miniPlayer(); } } }; @@ -385,20 +385,17 @@ ImprovedTube.playerOnTimeUpdate = function () { }; ImprovedTube.playerOnLoadedMetadata = function () { - setTimeout(function () { - ImprovedTube.playerSize(); - }, 100); + setTimeout(function () {ImprovedTube.playerSize();}, 100); }; ImprovedTube.playerOnPause = function (event) { ImprovedTube.playlistUpNextAutoplay(event); if (ImprovedTube.elements.yt_channel_name) { - ImprovedTube.messages.send({ - action: 'analyzer', - name: ImprovedTube.elements.yt_channel_name.__data.tooltipText, - time: ImprovedTube.played_time - }); + ImprovedTube.messages.send({action: 'analyzer', + name: ImprovedTube.elements.yt_channel_name.__data.tooltipText, + time: ImprovedTube.played_time + }); } ImprovedTube.played_time = 0; ImprovedTube.playerControls(); @@ -407,22 +404,18 @@ ImprovedTube.playerOnPause = function (event) { ImprovedTube.playerOnEnded = function (event) { ImprovedTube.playlistUpNextAutoplay(event); - ImprovedTube.messages.send({ - action: 'analyzer', - //adding "?" (not a fix) - name: ImprovedTube.elements.yt_channel_name?.__data.tooltipText, - time: ImprovedTube.played_time - }); + ImprovedTube.messages.send({action: 'analyzer', + //adding "?" (not a fix) + name: ImprovedTube.elements.yt_channel_name?.__data.tooltipText, + time: ImprovedTube.played_time + }); ImprovedTube.played_time = 0; }; ImprovedTube.onkeydown = function () { window.addEventListener('keydown', function () { - if ( - ImprovedTube.elements.player && - ImprovedTube.elements.player.className.indexOf('ad-showing') === -1 - ) { + if (ImprovedTube.elements.player && ImprovedTube.elements.player.className.indexOf('ad-showing') === -1) { ImprovedTube.ignore_autoplay_off = true; } }, true); @@ -434,14 +427,10 @@ ImprovedTube.onmousedown = function (event) { var path = event.composedPath(); for (var i = 0, l = path.length; i < l; i++) { - if ( - path[i].className && - path[i].className.indexOf && - ( - path[i].className.indexOf('html5-main-video') !== -1 || - path[i].className.indexOf('ytp-play-button') !== -1 - ) - ) { + if (path[i].className + && path[i].className.indexOf + && (path[i].className.indexOf('html5-main-video') !== -1 + || path[i].className.indexOf('ytp-play-button') !== -1)) { ImprovedTube.ignore_autoplay_off = true; } } @@ -449,17 +438,6 @@ ImprovedTube.onmousedown = function (event) { }, true); }; -ImprovedTube.getCookieValueByName = function (name) { - var match = document.cookie.match(new RegExp('([; ]' + name + '|^' + name + ')([^\\s;]*)', 'g')); - - if (match) { - var cookie = match[0]; - - return cookie.replace(name + '=', '').replace(' ', ''); - } else - return ''; -}; - ImprovedTube.getParam = function (query, name) { var params = query.split('&'), param = false; @@ -492,6 +470,36 @@ ImprovedTube.getParams = function (query) { return result; }; +ImprovedTube.getCookieValueByName = function (name) { + var match = document.cookie.match(new RegExp('([; ]' + name + '|^' + name + ')([^\\s;]*)', 'g')); + + if (match) { + var cookie = match[0]; + + return cookie.replace(name + '=', '').replace(' ', ''); + } else return ''; +}; + +ImprovedTube.setPrefCookieValueByName = function (name, value) { + let prefs = this.getParams(this.getCookieValueByName('PREF')); + let newprefs = ''; + let ampersant = ''; + + if (value) { + prefs[name] = value; + } + + for (let pref in prefs) { + if (pref) { + if (pref!=name || value) { + newprefs += ampersant + pref + '=' + prefs[pref]; + ampersant = '&'; + } + } + } + this.setCookie('PREF', newprefs); +}; + ImprovedTube.setCookie = function (name, value) { var date = new Date(); @@ -555,9 +563,10 @@ ImprovedTube.createPlayerButton = function (options) { controls.insertBefore(button, controls.childNodes[3]); } }; -ImprovedTube.empty = function (element) {for (var i = element.childNodes.length - 1; i > -1; i--) { element.childNodes[i].remove(); }}; -ImprovedTube.isset = function (variable) { return !(typeof variable === 'undefined' || variable === null || variable === 'null');}; -ImprovedTube.stopPropagation = function (event) { event.stopPropagation(); }; + +ImprovedTube.empty = function (element) {for (var i = element.childNodes.length - 1; i > -1; i--) { element.childNodes[i].remove(); }}; +ImprovedTube.isset = function (variable) {return !(typeof variable === 'undefined' || variable === null || variable === 'null');}; +ImprovedTube.stopPropagation = function (event) {event.stopPropagation();}; ImprovedTube.showStatus = function (value) { if (!this.elements.status) { this.elements.status = document.createElement('div'); @@ -575,32 +584,29 @@ ImprovedTube.showStatus = function (value) { clearTimeout(ImprovedTube.status_timer); } - ImprovedTube.status_timer = setTimeout(function () { - ImprovedTube.elements.status.remove(); - }, 500); + ImprovedTube.status_timer = setTimeout(function () {ImprovedTube.elements.status.remove();}, 500); this.elements.player.appendChild(this.elements.status); }; -ImprovedTube.videoId = function (url = document.URL) { return url.match(ImprovedTube.regex.video_id)[1] || url.searchParams.get('v') || movie_player.getVideoData().video_id } -ImprovedTube.videoTitle = function () { return document.title?.replace(/\s*-\s*YouTube$/, '') || movie_player.getVideoData().title || document.querySelector('#title > h1 > *')?.textContent } +ImprovedTube.videoId = function (url = document.URL) {return url.match(ImprovedTube.regex.video_id)[1] || url.searchParams.get('v') || movie_player.getVideoData().video_id}; +ImprovedTube.videoTitle = function () {return document.title?.replace(/\s*-\s*YouTube$/, '') || movie_player.getVideoData().title || document.querySelector('#title > h1 > *')?.textContent}; // Function to extract and store the number of subscribers ImprovedTube.extractSubscriberCount = function (subscriberCountNode) { - if (!subscriberCountNode){var subscriberCountNode = document.getElementById('owner-sub-count');} - if (subscriberCountNode){ + if (!subscriberCountNode) {subscriberCountNode = document.getElementById('owner-sub-count');} + if (subscriberCountNode) { // Extract the subscriber count and store it for further use var subscriberCountText = subscriberCountNode.textContent.trim(); var subscriberCount = parseFloat(subscriberCountText.replace(/[^0-9.]/g, '')); - + if (subscriberCountText.includes('K')) { subscriberCount *= 1000; } else if (subscriberCountText.includes('M')) { subscriberCount *= 1000000; - } + } ImprovedTube.subscriberCount = subscriberCount; } }; - From d6d0dfaa8cd2c6c35145d419dc2f3cd82593383c Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 07:43:36 +0100 Subject: [PATCH 06/94] blocklist.js dynamic dynamically updated on all pages, can turn on/off and see results live without reloading page. Channel blocklist works now where channel info available in thumbnail container. --- .../www.youtube.com/blocklist.js | 339 +++++++++++------- 1 file changed, 200 insertions(+), 139 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/blocklist.js b/js&css/web-accessible/www.youtube.com/blocklist.js index 6fa0ea787..b6d8fae29 100644 --- a/js&css/web-accessible/www.youtube.com/blocklist.js +++ b/js&css/web-accessible/www.youtube.com/blocklist.js @@ -1,187 +1,248 @@ /*------------------------------------------------------------------------------ 4.8.0 BLOCKLIST ------------------------------------------------------------------------------*/ +// usage: +// () called only to turn On (rescans all elements on page)/Off +// ('video', node) called only for 'a#thumbnail.ytd-thumbnail[href]' +// ('channel', node) called only for 'ytd-subscribe-button-renderer.ytd-c4-tabbed-header-renderer' ImprovedTube.blocklist = function (type, node) { + if (this.storage.blocklist_activate) { + if (type === 'video') { + if (node.nodeName !== 'A' || !node.href) { alert(1) }; + const video = node.href.match(ImprovedTube.regex.video_id)?.[1], + channel = node.parentNode.__dataHost?.__data?.data?.shortBylineText?.runs?.[0]?.navigationEndpoint?.commandMetadata?.webCommandMetadata?.url ? node.parentNode.__dataHost.__data.data.shortBylineText.runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url.match(ImprovedTube.regex.channel).groups.name : undefined; + let mode = 'video', + blockedElement; + if (!video) return; // no video ID, something went horribly wrong, bail + + // YT reuses VIDEO elements dynamically, need to monitor and also dynamically readjust BLOCK style + if (!this.elements.observerList.includes(node)) { + // YT reuses VIDEO elements dynamically, need to monitor and also dynamically readjust BLOCK style whenever href is modified + this.blocklistObserver.observe(node, {attributes: true, + attributeFilter: ['href']}); + // keep track to only attach one observer per element + this.elements.observerList.push(node); + } - if (this.storage.blocklist_activate !== true) { - // for (var i = 0, l = this.elements.blocklist_buttons.length; i < l; i++) { - // this.elements.blocklist_buttons[i].remove(); - return; - } else if (!node) { - var a = document.querySelectorAll('a.ytd-thumbnail'), - a2 = document.querySelectorAll('a[href*="/channel/"],a[href*="/user/"],a[href*="/c/"],a[href*="/@"]'), - subscribe_buttons = document.querySelectorAll('ytd-subscribe-button-renderer.ytd-c4-tabbed-header-renderer'); - - for (var i = 0, l = a.length; i < l; i++) { - this.blocklist('video', a[i]); - } - - for (var i = 0, l = subscribe_buttons.length; i < l; i++) { - this.blocklist('channel', subscribe_buttons[i]); - } - - for (var i = 0, l = a2.length; i < l; i++) { - this.blocklist('channel', a2[i]); - } - } - - if (!this.storage.blocklist || typeof this.storage.blocklist !== 'object') { - this.storage.blocklist = { - channels: {}, - videos: {} - }; - } + switch(node.parentNode.className.replace('style-scope ','')) { + case 'ytd-compact-video-renderer': + // list next to player + // node.parentNode.__dataHost.$.dismissible; + case 'ytd-rich-item-renderer': + // short reel + case 'ytd-rich-grid-media': + // grid reel + case 'ytd-rich-grid-slim-media': + // short grid reel + case 'ytd-playlist-video-renderer': + // playlist page + case 'ytd-playlist-panel-video-renderer': + // playlist next to player + // node.parentNode.closest('ytd-playlist-panel-video-renderer') + case 'ytd-structured-description-video-lockup-renderer': + // list under the player + // node.parentNode.closest('ytd-structured-description-video-lockup-renderer') + // or even node.parentNode.closest('ytd-compact-infocard-renderer') === node.parentNode.parentNode.parentNode.parentNode + blockedElement = node.parentNode.parentNode.parentNode; + break; + case 'ytd-grid-video-renderer': + // channel home screen grid + case 'ytd-reel-item-renderer': + // reel + blockedElement = node.parentNode.parentNode; + break; + } - if (!this.storage.blocklist.channels || typeof this.storage.blocklist.channels !== 'object') { - this.storage.blocklist.channels = {}; - } + if (!blockedElement) return; // couldnt find valid enveloping element, bail - if (!this.storage.blocklist.videos || typeof this.storage.blocklist.videos !== 'object') { - this.storage.blocklist.videos = {}; - } + node.blockedElement = blockedElement; - if (type === 'video') { - var id = node.href.match(ImprovedTube.regex.video_id); - // Hide blocklisted videos: - if (id && id[1] && ImprovedTube.storage.blocklist.videos[id[1]]) { - //node.__dataHost.classList.add('it-blocklisted-video'); // this only affects the thumbnail - const dismissibleElement = node.parentNode.__dataHost.$.dismissible; - if (dismissibleElement) { dismissibleElement.classList.add('it-blocklisted-video'); } // this affects the title and co. as well - // node.parentNode.parentNode.__dataHost.$.ytd-compact-video-renderer.classList.add('it-blocklisted-video'); - } + if (this.storage.blocklist.videos[video] && !blockedElement.classList.contains('it-blocklisted-video')) { + // blocklisted video + blockedElement.classList.add('it-blocklisted-video'); + } else if (!this.storage.blocklist.videos[video] && blockedElement.classList.contains('it-blocklisted-video')) { + // video not blocklisted, show it + blockedElement.classList.remove('it-blocklisted-video'); + } - // skip blocklist button creation, if it exists already: - if(node.getElementsByClassName("it-add-to-blocklist").length > 0){ - return - } - - var button = document.createElement('button'), - svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'), - path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); - - button.className = 'it-add-to-blocklist'; - button.addEventListener('click', function (event) { - if (this.parentNode.href) { - var data = this.parentNode.__dataHost.__data, - id = this.parentNode.href.match(ImprovedTube.regex.video_id), - title = ''; - - if ( - data && - data.data && - data.data.title && - data.data.title.runs && - data.data.title.runs[0] - ) { - title = data.data.title.runs[0].text; - } else if ( - data && - data && - data.data && - data.data.title.simpleText - ) { - title = data.data.title.simpleText; + if (channel) { + // this thumbnail has channel information, can try channel blocklist + if (this.storage.blocklist.channels[channel] && !blockedElement.classList.contains('it-blocklisted-channel')) { + // blocked channel? = block all videos from that channel + blockedElement.classList.add('it-blocklisted-channel'); + } else if (!this.storage.blocklist.channels[channel] && blockedElement.classList.contains('it-blocklisted-channel')) { + // channel not blocked, show it + blockedElement.classList.remove('it-blocklisted-channel'); } + } - if (id && id[1]) { - ImprovedTube.messages.send({ - action: 'blocklist', - type: 'video', - id: id[1], - title: title - }); + if (node.querySelector("button.it-add-to-blocklist")) return; // skip blocklist button creation if one already exists - ImprovedTube.storage.blocklist.videos[id[1]] = { - title: title - }; + let button = document.createElement('button'), + svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'), + path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); - this.parentNode.parentNode.__dataHost.className += ' it-blocklisted-video'; + button.className = 'it-add-to-blocklist'; + button.addEventListener('click', function (event) { + if (this.parentNode.href) { + + const video = node.href.match(ImprovedTube.regex.video_id)?.[1], + channel = node.parentNode.__dataHost?.__data?.data?.shortBylineText?.runs?.[0]?.navigationEndpoint?.commandMetadata?.webCommandMetadata?.url ? node.parentNode.__dataHost.__data.data.shortBylineText.runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url.match(ImprovedTube.regex.channel).groups.name : undefined, + data = this.parentNode.__dataHost.__data?.data?.title, + blockedElement = node.blockedElement; + let title, + added = false, + type = 'video'; + + if (!video || !blockedElement) return; // need both video ID and blockedElement, otherwise bail + + if (data?.runs?.[0]?.text) { + title = data.runs[0].text; + } else if (data?.simpleText) { + title = data.simpleText; + } + if (channel && blockedElement.classList.contains('it-blocklisted-channel')) { + // unblocking channel + type = 'channel'; + } else if (blockedElement.classList.contains('it-blocklisted-video')) { + // unblocking blocklisted video + } else { + // nothing blocked, clicking should block this video + added = true; + } + ImprovedTube.messages.send({action: 'blocklist', + added: added, + type: type, + id: type == 'channel' ? channel : video, + title: title}); event.preventDefault(); event.stopPropagation(); } - } - }, true); + }, true); - svg.setAttributeNS(null, 'viewBox', '0 0 24 24'); - path.setAttributeNS(null, 'd', 'M12 2a10 10 0 100 20 10 10 0 000-20zm0 18A8 8 0 015.69 7.1L16.9 18.31A7.9 7.9 0 0112 20zm6.31-3.1L7.1 5.69A8 8 0 0118.31 16.9z'); + svg.setAttributeNS(null, 'viewBox', '0 0 24 24'); + path.setAttributeNS(null, 'd', 'M12 2a10 10 0 100 20 10 10 0 000-20zm0 18A8 8 0 015.69 7.1L16.9 18.31A7.9 7.9 0 0112 20zm6.31-3.1L7.1 5.69A8 8 0 0118.31 16.9z'); - svg.appendChild(path); - button.appendChild(svg); + svg.appendChild(path); + button.appendChild(svg); - node.appendChild(button); + node.appendChild(button); + this.elements.blocklist_buttons.push(button); + } else if (type === 'channel') { + let button = node.parentNode.parentNode.querySelector("button.it-add-channel-to-blocklist"), + id = location.href.match(ImprovedTube.regex.channel).groups.name; - if (this.elements && this.elements.blocklist_buttons && Array.isArray(this.elements.blocklist_buttons)){ - this.elements.blocklist_buttons.push(button); - } - } else if (type === 'channel') { - if (node.nodeName === 'A') { - try { - var id = node.href.match(ImprovedTube.regex.channel).groups.name; - - if (this.storage.blocklist.channels[id]) { - var parent = node.parentNode//.__dataHost.__dataHost; - - if ( parent.__dataHost.$.dismissible - //parent.nodeName === 'YTD-GRID-VIDEO-RENDERER' || - //parent.nodeName === 'YTD-VIDEO-META-BLOCK' - ) { - parent.__dataHost.$.dismissible.classList.add('it-blocklisted-video'); // this affects the title and co. as well - // parent.__dataHost.$.ytd-compact-video-renderer.classList.add('it-blocklisted-video'); - } + // skip channel blocklist button creation if one already exists + if (button) { + if (this.storage.blocklist.channels[id] && button.added) { + button.innerText = 'Remove from blocklist'; + button.added = false; + } else if (!this.storage.blocklist.channels[id] && !button.added) { + button.innerText = 'Add to blocklist'; + button.added = true; } - } catch (err) {} - } else { - var button = this.elements.blocklistChannel || document.createElement('button'), - id = location.href.match(ImprovedTube.regex.channel).groups.name; + return; + } + button = document.createElement('button'); button.className = 'it-add-channel-to-blocklist'; if (this.storage.blocklist.channels[id]) { button.innerText = 'Remove from blocklist'; - button.added = true; + button.added = false; } else { button.innerText = 'Add to blocklist'; - button.added = false; + button.added = true; } button.addEventListener('click', function (event) { - var data = this.parentNode.__dataHost.__data.data, + let data = this.parentNode.__dataHost.__data.data, id = location.href.match(ImprovedTube.regex.channel).groups.name; - this.added = !this.added; - - ImprovedTube.messages.send({ - action: 'blocklist', - type: 'channel', - id: id, - title: data.title, - prevent: data.avatar.thumbnails[0].url - }); - - ImprovedTube.storage.blocklist.channels[id] = { - title: data.title, - prevent: data.avatar.thumbnails[0].url - }; - - if (this.added) { + if (this.added) { // adding + ImprovedTube.storage.blocklist.channels[id] = {title: data.title, + preview: data.avatar.thumbnails[0].url}; button.innerText = 'Remove from blocklist'; - } else { + } else { // removing + delete ImprovedTube.storage.blocklist.channels[id]; button.innerText = 'Add to blocklist'; } + ImprovedTube.messages.send({action: 'blocklist', + added: this.added, + type: 'channel', + id: id, + title: data.title, + preview: data.avatar.thumbnails[0].url}); + this.added = !this.added; event.preventDefault(); event.stopPropagation(); - - return false; }, true); + node.parentNode.parentNode.appendChild(button); this.elements.blocklist_buttons.push(button); + } else if (arguments.length == 0) { + // scan whole page + for (let thumbnails of document.querySelectorAll('a.ytd-thumbnail[href]')) { + this.blocklist('video', thumbnails); + } + if (document.querySelector('ytd-subscribe-button-renderer.ytd-c4-tabbed-header-renderer')) { + this.blocklist('channel', document.querySelector('ytd-subscribe-button-renderer.ytd-c4-tabbed-header-renderer')); + } + } + } else { + // remove blocklist buttons + for (let blocked of this.elements.blocklist_buttons) { + blocked.remove(); + } + this.elements.blocklist_buttons = []; + // clear observers list + if (this.elements.observerList) { + this.elements.observerList = []; + // release observer + ImprovedTube.blocklistObserver.disconnect(); + } + // remove all blocks from videos\channels + for (let blocked of document.querySelectorAll('.it-blocklisted-video, .it-blocklisted-channel')) { + blocked.classList.remove('it-blocklisted-video'); + blocked.classList.remove('it-blocklisted-channel'); + } + } +}; - node.parentNode.parentNode.appendChild(button); +//if (document.readyState !== 'complete') {console.log('loooad', this.storage.blocklist_activate);document.addEventListener('DOMContentLoaded', ImprovedTube.blocklist())} + +console.log(document.readyState, document.querySelectorAll('a.ytd-thumbnail[href]')); - this.elements.blocklistChannel = button; + +ImprovedTube.blocklistObserver = new MutationObserver(function (mutationList) { + for (var mutation of mutationList) { + const video = mutation.target.href.match(ImprovedTube.regex.video_id)?.[1], + channel = mutation.target.parentNode.__dataHost?.__data?.data?.shortBylineText?.runs?.[0]?.navigationEndpoint?.commandMetadata?.webCommandMetadata?.url ? mutation.target.parentNode.__dataHost.__data.data.shortBylineText.runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url.match(ImprovedTube.regex.channel).groups.name : undefined, + blockedElement = mutation.target.blockedElement; + + if (!video || !blockedElement) return; // need both video ID and blockedElement, otherwise bail + + if (ImprovedTube.storage.blocklist.videos[video]) { + if (!blockedElement.classList.contains('it-blocklisted-video')) { + blockedElement.classList.add('it-blocklisted-video'); + } + } else { + if (blockedElement.classList.contains('it-blocklisted-video')) { + blockedElement.classList.remove('it-blocklisted-video'); + } } + + + if (channel && ImprovedTube.storage.blocklist.channels[channel] && !blockedElement.classList.contains('it-blocklisted-channel')) { + // blocked channel? = block all videos from that channel + blockedElement.classList.add('it-blocklisted-channel'); + } else if ((!channel || !ImprovedTube.storage.blocklist.channels[channel]) && blockedElement.classList.contains('it-blocklisted-channel')) { + // channel not blocked, show it + blockedElement.classList.remove('it-blocklisted-channel'); + } + } -}; +}); From 4ce0a86286f070005c76fb67776134b30fa5866c Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 07:51:48 +0100 Subject: [PATCH 07/94] Update core.js new needed element --- js&css/web-accessible/core.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js&css/web-accessible/core.js b/js&css/web-accessible/core.js index e349a30e2..950c81381 100644 --- a/js&css/web-accessible/core.js +++ b/js&css/web-accessible/core.js @@ -27,7 +27,8 @@ var ImprovedTube = { comments: {}, collapse_of_subscription_sections: [], mark_watched_videos: [], - blocklist_buttons: [] + blocklist_buttons: [], + observerList: [] }, regex: { channel: /\/(@|c\/@?|channel\/|user\/)(?[^/]+)/, @@ -167,9 +168,10 @@ document.addEventListener('it-message-from-extension', function () { localStorage.removeItem('it-player30fps'); } -// FEEDBACK WHEN THE USER CHANGED A SETTING ImprovedTube.init(); - } else if (message.action === 'storage-changed') { + // need to run blocklist once just after page load to catch initial nodes + ImprovedTube.blocklist(); + } else if (message.action === 'storage-changed') { // FEEDBACK WHEN USER CHANGES A SETTING var camelized_key = message.camelizedKey; ImprovedTube.storage[message.key] = message.value; @@ -330,4 +332,4 @@ ImprovedTube.messages.send = function (message) { document.dispatchEvent(new CustomEvent('it-message-from-youtube')); } -}; \ No newline at end of file +}; From cc74c1246e8bbe90676737c0625b724de9acda9d Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 07:58:07 +0100 Subject: [PATCH 08/94] core.js formatting, restructured --- js&css/web-accessible/core.js | 260 ++++++++++++++++++++++------------ 1 file changed, 173 insertions(+), 87 deletions(-) diff --git a/js&css/web-accessible/core.js b/js&css/web-accessible/core.js index 950c81381..8ed0cc949 100644 --- a/js&css/web-accessible/core.js +++ b/js&css/web-accessible/core.js @@ -11,7 +11,7 @@ /*-------------------------------------------------------------- # GLOBAL VARIABLE --------------------------------------------------------------*/ - + var ImprovedTube = { messages: { queue: [] @@ -76,28 +76,28 @@ CODEC || 30FPS file to patch HTMLMediaElement before YT player uses it. --------------------------------------------------------------*/ if (localStorage['it-codec'] || localStorage['it-player30fps']) { - function overwrite(self, callback, mime) { + function override(self, callback, mime) { if (localStorage['it-codec']) { - var re = new RegExp(localStorage['it-codec']); + let re = new RegExp(localStorage['it-codec']); // /webm|vp8|vp9|av01/ if (re.test(mime)) return ''; } if (localStorage['it-player30fps']) { - var match = /framerate=(\d+)/.exec(mime); + let match = /framerate=(\d+)/.exec(mime); if (match && match[1] > 30) return ''; } return callback.call(self, mime); }; if (window.MediaSource) { - var isTypeSupported = window.MediaSource.isTypeSupported; + let isTypeSupported = window.MediaSource.isTypeSupported; window.MediaSource.isTypeSupported = function (mime) { - return overwrite(this, isTypeSupported, mime); + return override(this, isTypeSupported, mime); } } - var canPlayType = HTMLMediaElement.prototype.canPlayType; + let canPlayType = HTMLMediaElement.prototype.canPlayType; HTMLMediaElement.prototype.canPlayType = function (mime) { - return overwrite(this, canPlayType, mime); + return override(this, canPlayType, mime); } }; @@ -154,7 +154,7 @@ document.addEventListener('it-message-from-extension', function () { if (message.action === 'storage-loaded') { ImprovedTube.storage = message.storage; - + if (ImprovedTube.storage.block_vp9 || ImprovedTube.storage.block_av1 || ImprovedTube.storage.block_h264) { let atlas = {block_vp9:'vp9|vp09', block_h264:'avc1', block_av1:'av01'} localStorage['it-codec'] = Object.keys(atlas).reduce(function (all, key) { @@ -171,11 +171,12 @@ document.addEventListener('it-message-from-extension', function () { ImprovedTube.init(); // need to run blocklist once just after page load to catch initial nodes ImprovedTube.blocklist(); + } else if (message.action === 'storage-changed') { // FEEDBACK WHEN USER CHANGES A SETTING var camelized_key = message.camelizedKey; ImprovedTube.storage[message.key] = message.value; - if(['block_vp9', 'block_h264', 'block_av1'].includes(message.key)){ + if (['block_vp9', 'block_h264', 'block_av1'].includes(message.key)) { let atlas = {block_vp9:'vp9|vp09', block_h264:'avc1', block_av1:'av01'} localStorage['it-codec'] = Object.keys(atlas).reduce(function (all, key) { return ImprovedTube.storage[key] ? ((all?all+'|':'') + atlas[key]) : all}, ''); @@ -183,91 +184,176 @@ document.addEventListener('it-message-from-extension', function () { localStorage.removeItem('it-codec'); } } - if(message.key==="player_60fps"){ + if (message.key==="player_60fps") { if (ImprovedTube.storage.player_60fps === false) { - localStorage['it-player30fps'] = true; + localStorage['it-player30fps'] = true; } else { localStorage.removeItem('it-player30fps'); } } - if(ImprovedTube.storage[message.key]==="when_paused"){ + if (ImprovedTube.storage[message.key]==="when_paused") { ImprovedTube.whenPaused(); }; - if (camelized_key === 'blocklistActivate') { - camelized_key = 'blocklist'; - } else if (camelized_key === 'playerPlaybackSpeed' || camelized_key === 'playerForcedPlaybackSpeed') - { if ( ImprovedTube.storage.player_forced_playback_speed === true ) { ImprovedTube.elements.player.setPlaybackRate(Number(ImprovedTube.storage.player_playback_speed)); ImprovedTube.elements.player.querySelector('video').playbackRate = Number(ImprovedTube.storage.player_playback_speed) } - if ( ImprovedTube.storage.player_forced_playback_speed === false) { ImprovedTube.elements.player.setPlaybackRate(Number(1)); ImprovedTube.elements.player.querySelector('video').playbackRate = Number(1) } - } else if (camelized_key === 'theme') { - ImprovedTube.myColors(); - ImprovedTube.setTheme(); - } else if (camelized_key === 'description') { - if (ImprovedTube.storage.description === "expanded" || ImprovedTube.storage.description === "classic_expanded" ) - {try{document.querySelector("#more").click() || document.querySelector("#expand").click() ;} catch{} } - if (ImprovedTube.storage.description === "normal" || ImprovedTube.storage.description === "classic" ) - {try{document.querySelector("#less").click() || document.querySelector("#collapse").click();} catch{}} - ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); - } - else if (camelized_key === 'transcript') { - if (ImprovedTube.storage.transcript === true) {document.querySelector('*[target-id*=transcript]')?.removeAttribute('visibility');} - if (ImprovedTube.storage.transcript === false){document.querySelector('*[target-id*=transcript] #visibility-button button')?.click();} - } - else if (camelized_key === 'chapters') { - if (ImprovedTube.storage.chapters === true){document.querySelector('*[target-id*=chapters]')?.removeAttribute('visibility');} - if (ImprovedTube.storage.chapters === false){document.querySelector('*[target-id*=chapters] #visibility-button button')?.click();} - } - else if (camelized_key === 'commentsSidebar') { - if(ImprovedTube.storage.comments_sidebar === false) - {document.querySelector("#below").appendChild(document.querySelector("#comments")); - document.querySelector("#secondary").appendChild(document.querySelector("#related")); } - else{ImprovedTube.commentsSidebar();} - } - else if (camelized_key === 'forcedTheaterMode') { if(ImprovedTube.storage.forced_theater_mode === false && ImprovedTube.elements.ytd_watch && ImprovedTube.elements.player){ - var button = ImprovedTube.elements.player.querySelector("button.ytp-size-button"); - if (button && ImprovedTube.elements.ytd_watch.theater === true) { - ImprovedTube.elements.ytd_watch.theater = false; - setTimeout(function () { button.click();}, 100); } - } - } else if (camelized_key === 'playerScreenshotButton' && ImprovedTube.storage.player_screenshot_button === false) { - if (ImprovedTube.elements.buttons['it-screenshot-button']) { - ImprovedTube.elements.buttons['it-screenshot-button']?.remove(); ImprovedTube.elements.buttons['it-screenshot-styles']?.remove();} - } else if (camelized_key === 'playerRepeatButton' && ImprovedTube.storage.player_repeat_button === false) { - if (ImprovedTube.elements.buttons['it-repeat-button']) { - ImprovedTube.elements.buttons['it-repeat-button']?.remove(); ImprovedTube.elements.buttons['it-repeat-styles']?.remove();} - } else if (camelized_key === 'playerPopupButton' && ImprovedTube.storage.player_popup_button === false) { - ImprovedTube.elements.buttons['it-popup-player-button']?.remove(); - } else if (camelized_key === 'playerRotateButton' && ImprovedTube.storage.player_rotate_button === false) { - ImprovedTube.elements.buttons['it-rotate-button']?.remove(); ImprovedTube.elements.buttons['it-rotate-styles']?.remove(); - } else if ( camelized_key === 'playerFitToWinButton' && ImprovedTube.storage.player_fit_to_win_button === false) { - ImprovedTube.elements.buttons['it-fit-to-win-player-button']?.remove(); - document.querySelector("html")?.setAttribute("it-player-size", ImprovedTube.storage.player_size ?? "do_not_change"); - } else if (camelized_key === 'playerHamburgerButton') { if(ImprovedTube.storage.player_hamburger_button == false) { - document.querySelector('.custom-hamburger-menu')?.remove(); - let rightControls = document.querySelector('.html5-video-player')?.querySelector('.ytp-right-controls'); - if (rightControls) { - rightControls.style.setProperty('padding-right', ''); // Restoring the original padding: - rightControls.style.setProperty('display', 'flex'); } } - } else if ( camelized_key === 'belowPlayerPip' ){ - if (ImprovedTube.storage.below_player_pip === false) { document.querySelector('.improvedtube-player-button[data-tooltip="PiP"]')?.remove();} - if (ImprovedTube.storage.below_player_pip === true) { document.querySelectorAll('.improvedtube-player-button').forEach(e => e.remove()); ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); } - } else if ( camelized_key === 'belowPlayerScreenshot' ){ - if (ImprovedTube.storage.below_player_screenshot === false) { document.querySelector('.improvedtube-player-button[data-tooltip="Screenshot"]')?.remove();} - if (ImprovedTube.storage.below_player_screenshot === true) { document.querySelectorAll('.improvedtube-player-button').forEach(e => e.remove());; ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); } - } else if ( camelized_key === 'belowPlayerLoop' ){ - if (ImprovedTube.storage.below_player_loop === false) { document.querySelector('.improvedtube-player-button[data-tooltip="Loop"]')?.remove();} - if (ImprovedTube.storage.below_player_loop === true) { document.querySelectorAll('.improvedtube-player-button').forEach(e => e.remove()); ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); } - } else if ( camelized_key === 'dayOfWeek') { - if (ImprovedTube.storage.day_of_week === false) { document.querySelector(".ytd-day-of-week")?.remove(); } - if (ImprovedTube.storage.day_of_week === true) { ImprovedTube.dayOfWeek(); } - } else if ( camelized_key === 'playerRemainingDuration' ) { - if (ImprovedTube.storage.player_remaining_duration === false) {document.querySelector(".ytp-time-remaining-duration")?.remove();} - if (ImprovedTube.storage.player_remaining_duration === true) { ImprovedTube.playerRemainingDuration(); } - } else if (camelized_key === 'blocklistActivate' ) { - if (ImprovedTube.storage.blocklist_activate === true) {document.querySelectorAll('.it-add-to-blocklist').forEach(e => e.remove());} - //We do this type automatically: //} else if ( camelized_key === 'hideVideoTitleFullScreen' ) { - //if (ImprovedTube.storage.hide_video_title_fullScreen === false) {document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'block');} - //if (ImprovedTube.storage.hide_video_title_fullScreen === true) {document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'none'); } + + switch(camelized_key) { + case 'blocklistActivate': + camelized_key = 'blocklist'; + break + + case 'playerPlaybackSpeed': + case 'playerForcedPlaybackSpeed': + if (ImprovedTube.storage.player_forced_playback_speed === true) { + ImprovedTube.elements.player.setPlaybackRate(Number(ImprovedTube.storage.player_playback_speed)); + ImprovedTube.elements.player.querySelector('video').playbackRate = Number(ImprovedTube.storage.player_playback_speed); + } else if (ImprovedTube.storage.player_forced_playback_speed === false) { + ImprovedTube.elements.player.setPlaybackRate(1); + ImprovedTube.elements.player.querySelector('video').playbackRate = 1; + } + break + + case 'theme': + case 'themePrimaryColor': + case 'themeTextColor': + ImprovedTube.setTheme(); + break + + case 'description': + if (ImprovedTube.storage.description === "expanded" || ImprovedTube.storage.description === "classic_expanded") { + try{document.querySelector("#more").click() || document.querySelector("#expand").click();} catch{} + } else if (ImprovedTube.storage.description === "normal" || ImprovedTube.storage.description === "classic") { + try{document.querySelector("#less").click() || document.querySelector("#collapse").click();} catch{} + } + ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); + break + + case 'transcript': + if (ImprovedTube.storage.transcript === true) { + document.querySelector('*[target-id*=transcript]')?.removeAttribute('visibility'); + } else if (ImprovedTube.storage.transcript === false) { + document.querySelector('*[target-id*=transcript] #visibility-button button')?.click(); + } + break + + case 'chapters': + if (ImprovedTube.storage.chapters === true) { + document.querySelector('*[target-id*=chapters]')?.removeAttribute('visibility'); + } else if (ImprovedTube.storage.chapters === false) { + document.querySelector('*[target-id*=chapters] #visibility-button button')?.click(); + } + break + + case 'commentsSidebar': + if (ImprovedTube.storage.comments_sidebar === false) { + document.querySelector("#below").appendChild(document.querySelector("#comments")); + document.querySelector("#secondary").appendChild(document.querySelector("#related")); + } else { + ImprovedTube.commentsSidebar(); + } + break + + case 'forcedTheaterMode': + if (ImprovedTube.storage.forced_theater_mode === false && ImprovedTube.elements.ytd_watch && ImprovedTube.elements.player) { + var button = ImprovedTube.elements.player.querySelector("button.ytp-size-button"); + if (button && ImprovedTube.elements.ytd_watch.theater === true) { + ImprovedTube.elements.ytd_watch.theater = false; + setTimeout(function () { button.click();}, 100); + } + } + break + + case 'playerScreenshotButton': + if (ImprovedTube.storage.player_screenshot_button === false) { + if (ImprovedTube.elements.buttons['it-screenshot-button']) { + ImprovedTube.elements.buttons['it-screenshot-button']?.remove(); + ImprovedTube.elements.buttons['it-screenshot-styles']?.remove(); + } + } + break + + case 'playerRepeatButton': + if (ImprovedTube.storage.player_repeat_button === false) { + if (ImprovedTube.elements.buttons['it-repeat-button']) { + ImprovedTube.elements.buttons['it-repeat-button']?.remove(); + ImprovedTube.elements.buttons['it-repeat-styles']?.remove(); + } + } + break + + case 'playerPopupButton': + if (ImprovedTube.storage.player_popup_button === false) { + ImprovedTube.elements.buttons['it-popup-player-button']?.remove(); + } + break + + case 'playerRotateButton': + if (ImprovedTube.storage.player_rotate_button === false) { + ImprovedTube.elements.buttons['it-rotate-button']?.remove(); + ImprovedTube.elements.buttons['it-rotate-styles']?.remove(); + } + break + + case 'playerFitToWinButton': + if (ImprovedTube.storage.player_fit_to_win_button === false) { + ImprovedTube.elements.buttons['it-fit-to-win-player-button']?.remove(); + document.querySelector("html")?.setAttribute("it-player-size", ImprovedTube.storage.player_size ?? "do_not_change"); + } + break + + case 'playerHamburgerButton': + if (ImprovedTube.storage.player_hamburger_button == false) { + document.querySelector('.custom-hamburger-menu')?.remove(); + let rightControls = document.querySelector('.html5-video-player')?.querySelector('.ytp-right-controls'); + if (rightControls) { + rightControls.style.setProperty('padding-right', ''); // Restoring the original padding: + rightControls.style.setProperty('display', 'flex'); + } + } + break + + case 'belowPlayerPip': + if (ImprovedTube.storage.below_player_pip === false) { + document.querySelector('.improvedtube-player-button[data-tooltip="PiP"]')?.remove(); + } else if (ImprovedTube.storage.below_player_pip === true) { + document.querySelectorAll('.improvedtube-player-button').forEach(e => e.remove()); + ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); + } + break + + case 'belowPlayerScreenshot': + if (ImprovedTube.storage.below_player_screenshot === false) { + document.querySelector('.improvedtube-player-button[data-tooltip="Screenshot"]')?.remove(); + } else if (ImprovedTube.storage.below_player_screenshot === true) { + document.querySelectorAll('.improvedtube-player-button').forEach(e => e.remove()); + ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); + } + break + + case 'belowPlayerLoop': + if (ImprovedTube.storage.below_player_loop === false) { + document.querySelector('.improvedtube-player-button[data-tooltip="Loop"]')?.remove(); + } else if (ImprovedTube.storage.below_player_loop === true) { + document.querySelectorAll('.improvedtube-player-button').forEach(e => e.remove()); + ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); + } + break + + case 'dayOfWeek': + if (ImprovedTube.storage.day_of_week === false) { + document.querySelector(".ytd-day-of-week")?.remove(); + } else if (ImprovedTube.storage.day_of_week === true) { + ImprovedTube.dayOfWeek(); + } + break + + case 'playerRemainingDuration': + if (ImprovedTube.storage.player_remaining_duration === false) { + document.querySelector(".ytp-time-remaining-duration")?.remove(); + } else if (ImprovedTube.storage.player_remaining_duration === true) { + ImprovedTube.playerRemainingDuration(); + } + break } + if (ImprovedTube[camelized_key]) { try{ImprovedTube[camelized_key]()}catch{}; } From 490e71d312a4baf7157a350e86ccfbc98b591c6f Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 14 Mar 2024 07:58:50 +0100 Subject: [PATCH 09/94] Update blocklist.js removing leftover debug code --- js&css/web-accessible/www.youtube.com/blocklist.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/blocklist.js b/js&css/web-accessible/www.youtube.com/blocklist.js index b6d8fae29..31dc6db8c 100644 --- a/js&css/web-accessible/www.youtube.com/blocklist.js +++ b/js&css/web-accessible/www.youtube.com/blocklist.js @@ -212,11 +212,6 @@ ImprovedTube.blocklist = function (type, node) { } }; -//if (document.readyState !== 'complete') {console.log('loooad', this.storage.blocklist_activate);document.addEventListener('DOMContentLoaded', ImprovedTube.blocklist())} - -console.log(document.readyState, document.querySelectorAll('a.ytd-thumbnail[href]')); - - ImprovedTube.blocklistObserver = new MutationObserver(function (mutationList) { for (var mutation of mutationList) { const video = mutation.target.href.match(ImprovedTube.regex.video_id)?.[1], From 1e1ac8d64eb90f137ce0ba2927991412a78a9d3d Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 19 Mar 2024 02:48:33 +0100 Subject: [PATCH 10/94] Update blocklist.js shorts title --- js&css/web-accessible/www.youtube.com/blocklist.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/blocklist.js b/js&css/web-accessible/www.youtube.com/blocklist.js index 31dc6db8c..907def59b 100644 --- a/js&css/web-accessible/www.youtube.com/blocklist.js +++ b/js&css/web-accessible/www.youtube.com/blocklist.js @@ -89,7 +89,7 @@ ImprovedTube.blocklist = function (type, node) { const video = node.href.match(ImprovedTube.regex.video_id)?.[1], channel = node.parentNode.__dataHost?.__data?.data?.shortBylineText?.runs?.[0]?.navigationEndpoint?.commandMetadata?.webCommandMetadata?.url ? node.parentNode.__dataHost.__data.data.shortBylineText.runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url.match(ImprovedTube.regex.channel).groups.name : undefined, - data = this.parentNode.__dataHost.__data?.data?.title, + data = this.parentNode.__dataHost.__data?.data, blockedElement = node.blockedElement; let title, added = false, @@ -97,10 +97,12 @@ ImprovedTube.blocklist = function (type, node) { if (!video || !blockedElement) return; // need both video ID and blockedElement, otherwise bail - if (data?.runs?.[0]?.text) { - title = data.runs[0].text; - } else if (data?.simpleText) { - title = data.simpleText; + if (data?.title?.runs?.[0]?.text) { + title = data.title.runs[0].text; + } else if (data?.title?.simpleText) { + title = data.title.simpleText; + } else if (data?.headline?.simpleText) { + title = data.headline.simpleText; } if (channel && blockedElement.classList.contains('it-blocklisted-channel')) { From 01281e9647d461f7df12a6899293e049c4beadeb Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 3 Apr 2024 17:02:17 +0200 Subject: [PATCH 11/94] Update player.js slightly more readable autoplayDisable --- .../web-accessible/www.youtube.com/player.js | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index bed321991..5cda83e2b 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -2,23 +2,33 @@ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ ImprovedTube.autoplayDisable = function () { - var video = ImprovedTube.elements.player; - if (ImprovedTube.video_url !== location.href) { - this.user_interacted = false; - } - // if (allow autoplay is false) and (no ads playing) and - // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and it is not in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) - if (!this.user_interacted && video.classList.contains('ad-showing') === false && - ( -// quick fix #1703 thanks to @AirRaid#9957 - (/* document.documentElement.dataset.pageType === "video" */ location.href.indexOf('/watch?') !== -1 && ((location.href.indexOf('list=') === -1 && ImprovedTube.storage.player_autoplay_disable) || (ImprovedTube.storage.playlist_autoplay === false && location.href.indexOf('list=') !== -1))) || - (/* document.documentElement.dataset.pageType === "channel" */ ImprovedTube.regex.channel.test(location.href) && ImprovedTube.storage.channel_trailer_autoplay === false) - ) - ) - {if (!ImprovedTube.autoplayDeniedOnce) { - setTimeout(function () { video.pauseVideo(); }); - ImprovedTube.autoplayDeniedOnce = true; - } else { console.log("autoplay:off - should we pause here again?"); } } + let video = ImprovedTube.elements.player; + if (ImprovedTube.video_url !== location.href) { + this.user_interacted = false; + } + // if (no user clicks) and (no ads playing) and + // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) + + // user didnt click + if (!this.user_interacted + // no ads playing + && !video.classList.contains('ad-showing') + // video + && ((location.href.includes('/watch?') + // player_autoplay_disable & not playlist + && (ImprovedTube.storage.player_autoplay_disable && !location.href.includes('list=')) + // !playlist_autoplay & playlist + || (ImprovedTube.storage.playlist_autoplay === false && location.href.includes('list='))) + // channel homepage & !channel_trailer_autoplay + || (ImprovedTube.storage.channel_trailer_autoplay === false && ImprovedTube.regex.channel.test(location.href)))) { + + if (!ImprovedTube.autoplayDeniedOnce) { + setTimeout(function () { video.pauseVideo(); }); + ImprovedTube.autoplayDeniedOnce = true; + } else { + console.log("autoplay:off - should we pause here again?"); + } + } }; /*------------------------------------------------------------------------------ FORCED PLAY VIDEO FROM THE BEGINNING @@ -1425,4 +1435,4 @@ ImprovedTube.miniPlayer = function () { window.removeEventListener('scroll', this.miniPlayer_scroll); window.removeEventListener('mousemove', this.miniPlayer_cursorUpdate); } -}; \ No newline at end of file +}; From 6513ddad07987a613e81dc859764e949d1324c31 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 8 Apr 2024 13:04:57 +0200 Subject: [PATCH 12/94] Update satus.js limit writes to essential ones Dont save storage if new value is same as old value. The way satus works the mere act of displaying for example themes performs useless redundant writes. --- menu/satus.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index b1a4c6bd2..72236ce31 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -777,11 +777,13 @@ satus.render = function(skeleton, container, property, childrenOnly, prepend, sk set: function(val) { value = val; - if (skeleton.storage !== false) { - satus.storage.set(key, val); + if (satus.storage.get(key) != val) { + if (skeleton.storage !== false) { + satus.storage.set(key, val); + } + + parent.dispatchEvent(new CustomEvent('change')); } - - parent.dispatchEvent(new CustomEvent('change')); } } }); From 885f70b49763fc37052b472ec809b6e31551cf69 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 8 Apr 2024 17:01:47 +0200 Subject: [PATCH 13/94] Update active-features.js show themes --- menu/skeleton-parts/active-features.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/menu/skeleton-parts/active-features.js b/menu/skeleton-parts/active-features.js index 3c1ad2e14..ab6dd3ed1 100644 --- a/menu/skeleton-parts/active-features.js +++ b/menu/skeleton-parts/active-features.js @@ -10,15 +10,17 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = { variant: 'card', on: { render: function () { - var component = this; + let component = this; satus.search('', extension.skeleton, function (features) { - var skeleton = {}; + let skeleton = {}; - for (var key in features) { - var feature = features[key], + for (const key in features) { + let feature = features[key], default_value = feature.value, - value = satus.storage.get(feature.storage || key), + value = feature.storage && satus.storage.get(feature.storage) + || feature.radio && satus.storage.get(feature.radio.group) == feature.radio.value + || satus.storage.get(key), parent_object = feature; if (!satus.isset(default_value)) { @@ -40,7 +42,9 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = { } if (parent_object.parentObject) { - var category = parent_object.parentObject.label.text; + let category = parent_object.parentObject.label.text, + subcategory, + text; parent_object = feature; @@ -55,15 +59,15 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = { if (parent_object) { if (parent_object.label) { - var subcategory = parent_object.label.text; + subcategory = parent_object.label.text; } else { - var subcategory = parent_object.text; + subcategory = parent_object.text; } if (category === subcategory) { - var text = satus.locale.get(category); + text = satus.locale.get(category); } else { - var text = satus.locale.get(category) + ' > ' + satus.locale.get(subcategory); + text = satus.locale.get(category) + ' > ' + satus.locale.get(subcategory); } if (!skeleton[category + subcategory]) { @@ -131,4 +135,4 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = { component: 'span', text: 'activeFeatures' } -}; \ No newline at end of file +}; From c96d8cc8ad287a0ab85e57a654013761719582fe Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 8 Apr 2024 19:52:52 +0200 Subject: [PATCH 14/94] Update themes.js normalizing, removing redundant data can remove "default_theme": { "message": "default" }, from all locales --- menu/skeleton-parts/themes.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/menu/skeleton-parts/themes.js b/menu/skeleton-parts/themes.js index 62fd5b752..b4e3a8a90 100644 --- a/menu/skeleton-parts/themes.js +++ b/menu/skeleton-parts/themes.js @@ -1,8 +1,5 @@ /*-------------------------------------------------------------- >>> THEMES ----------------------------------------------------------------- -# Font -# Themes --------------------------------------------------------------*/ extension.skeleton.main.layers.section.themes = { @@ -10,12 +7,7 @@ extension.skeleton.main.layers.section.themes = { variant: 'themes', category: true, on: { - click: { - section: { - component: 'section', - variant: 'card' - } - } + click: {} }, icon: { @@ -46,7 +38,7 @@ extension.skeleton.main.layers.section.themes = { }; /*-------------------------------------------------------------- -# THEMES +# SECTION --------------------------------------------------------------*/ extension.skeleton.main.layers.section.themes.on.click.section = { @@ -62,7 +54,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { component: 'radio', group: 'theme', value: 'custom', - checked: true, on: { click: { section: { @@ -87,7 +78,7 @@ extension.skeleton.main.layers.section.themes.on.click.section = { default: { component: 'label', variant: 'default-theme', - text: 'default_theme', + text: 'default', radio: { component: 'radio', group: 'theme', From d0dbdbaf813a8967be8a4a2c079ca203423e3107 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 8 Apr 2024 19:56:59 +0200 Subject: [PATCH 15/94] Update themes.js formatting --- menu/skeleton-parts/themes.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/menu/skeleton-parts/themes.js b/menu/skeleton-parts/themes.js index b4e3a8a90..33a5f6179 100644 --- a/menu/skeleton-parts/themes.js +++ b/menu/skeleton-parts/themes.js @@ -49,7 +49,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { component: 'label', variant: 'custom-theme', text: 'custom', - radio: { component: 'radio', group: 'theme', @@ -90,7 +89,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { component: 'label', variant: 'black-theme', text: 'black', - radio: { component: 'radio', group: 'theme', @@ -101,7 +99,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { component: 'label', variant: 'plain-theme', text: 'plain', - radio: { component: 'radio', group: 'theme', @@ -122,7 +119,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { component: 'label', variant: 'night-theme', text: 'night', - radio: { component: 'radio', group: 'theme', @@ -133,7 +129,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { component: 'label', variant: 'dawn-theme', text: 'dawn', - radio: { component: 'radio', group: 'theme', From 7bd8d3ae7db01767589d37e28ca4f48d4baf74e8 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 8 Apr 2024 20:19:08 +0200 Subject: [PATCH 16/94] Update satus.js stop radio from writing on every render --- menu/satus.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 72236ce31..972790348 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1937,6 +1937,8 @@ satus.components.colorPicker = function(component, skeleton) { --------------------------------------------------------------*/ satus.components.radio = function(component, skeleton) { + let value; + component.nativeControl = component.createChildElement('input', 'input'); component.createChildElement('i'); @@ -1954,10 +1956,10 @@ satus.components.radio = function(component, skeleton) { component.nativeControl.value = skeleton.value; } - component.storage.value = satus.storage.get(component.storage.key); + value = satus.storage.get(component.storage.key); - if (satus.isset(component.storage.value)) { - component.nativeControl.checked = component.storage.value === skeleton.value; + if (satus.isset(value)) { + component.nativeControl.checked = value === skeleton.value; } else if (skeleton.checked) { component.nativeControl.checked = true; } From 8a165111a5fc5158b74e51b64a0dc0becd24cac1 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 8 Apr 2024 21:19:52 +0200 Subject: [PATCH 17/94] Update satus.js actually save just the value saved, not everything --- menu/satus.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 972790348..5a93469bc 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -983,13 +983,7 @@ satus.storage.set = function(key, value, callback) { } } - for (let key in this.data) { - if (typeof this.data[key] !== 'function') { - items[key] = this.data[key]; - } - } - - chrome.storage.local.set(items, function() { + chrome.storage.local.set({[key]: value}, function() { satus.events.trigger('storage-set'); if (callback) { From fef507782672f30f47bd9d70632a193c59610991 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 9 Apr 2024 00:12:57 +0200 Subject: [PATCH 18/94] Update styles.css make desert theme search button icon visible --- js&css/extension/www.youtube.com/styles.css | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index 115c15c31..3d0378cdd 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -1210,13 +1210,13 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen --yt-spec-text-primary: #555; --ytd-searchbox-border-color: #555; --ytd-searchbox-background: #faf9f9; - --ytd-searchbox-legacy-border-color: #555; - --ytd-searchbox-legacy-border-shadow-color: #555; - --ytd-searchbox-legacy-button-color: #555; - --ytd-searchbox-legacy-button-border-color: #555; - --ytd-searchbox-legacy-button-focus-color: #555; - --ytd-searchbox-legacy-button-hover-color: #555; - --ytd-searchbox-legacy-button-hover-border-color: #555; + --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); + --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); + --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); + --ytd-searchbox-legacy-button-border-color: hsl(0, 0%, 18.82%); + --ytd-searchbox-legacy-button-focus-color: hsla(0, 0%, 100%, .08); + --ytd-searchbox-legacy-button-hover-color: hsla(0, 0%, 100%, .08); + --ytd-searchbox-legacy-button-hover-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-button-icon-color: #fff; --ytd-moderation-panel-background: #555; --ytd-moderation-panel-hover: #555; From da4132b537c81ea684faa710915882a15395afa2 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 9 Apr 2024 02:53:31 +0200 Subject: [PATCH 19/94] Update satus.js color picker no longer writes during render --- menu/satus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 5a93469bc..46982cab2 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1765,8 +1765,6 @@ satus.components.colorPicker = function(component, skeleton) { set: function(value) { array = value; - this.parentNode.storage.value = array; - element.style.backgroundColor = 'rgb(' + value.join(',') + ')'; } }); @@ -1894,6 +1892,7 @@ satus.components.colorPicker = function(component, skeleton) { component = modal.parentElement; component.color.value = component.skeleton.value || [0, 0, 0]; + satus.storage.remove(component.storage.key); modal.rendered.close(); } @@ -1917,6 +1916,7 @@ satus.components.colorPicker = function(component, skeleton) { component = modal.parentElement; component.color.value = satus.color.hslToRgb(modal.value); + component.storage.value = component.color.value; modal.rendered.close(); } From de836d1526c76ded9cbd0b0734100db0a6689cd6 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 9 Apr 2024 02:58:30 +0200 Subject: [PATCH 20/94] Update satus.js let search reach themes, "My active features" shows current theme --- menu/satus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/satus.js b/menu/satus.js index b1a4c6bd2..13520ba35 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -3133,7 +3133,7 @@ satus.user.device.connection = function() { --------------------------------------------------------------*/ satus.search = function(query, object, callback) { - var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker'], + var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker', 'label'], threads = 0, results = {}, excluded = [ From 84cfa8705f1d9bd185856cbda2d471bf0b3efdab Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 9 Apr 2024 03:02:39 +0200 Subject: [PATCH 21/94] Update styles.css more work to make CSS overrides [dark] independent --- js&css/extension/www.youtube.com/styles.css | 41 ++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index 3d0378cdd..a1aa4c601 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -674,7 +674,7 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc --yt-spec-general-background-b: #000 !important; --yt-spec-general-background-c: #000 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #aaa !important; + --yt-spec-text-primary: #aaa; --yt-spec-text-primary-inverse: #000 !important; --yt-spec-text-secondary: #aaa !important; --yt-spec-text-disabled: #aaa !important; @@ -882,9 +882,10 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc /*DAWN*/ +html[it-theme=dawn] [dark], html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #d44d5c !important; --yt-swatch-primary-darker: #d44d5c !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -905,7 +906,7 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference --yt-spec-general-background-b: #d44d5c !important; --yt-spec-general-background-c: #d44d5c !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: rgb(255, 255, 255) !important; + --yt-spec-text-primary: rgb(255, 255, 255); --yt-spec-text-primary-inverse: #734 !important; --yt-spec-text-secondary: rgb(255, 255, 255) !important; --yt-spec-text-disabled: rgb(255, 255, 255) !important; @@ -1140,7 +1141,7 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen --yt-spec-general-background-b: #faf9f9 !important; --yt-spec-general-background-c: #faf9f9 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #555 !important; + --yt-spec-text-primary: #555; --yt-spec-text-primary-inverse: #faf9f9 !important; --yt-spec-text-secondary: #555 !important; --yt-spec-text-disabled: #555 !important; @@ -1336,9 +1337,10 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen /*NIGHT*/ +html[it-theme=night] [dark], html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #003459 !important; --yt-swatch-primary-darker: #003459 !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -1359,7 +1361,7 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc --yt-spec-general-background-b: #003459 !important; --yt-spec-general-background-c: #003459 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #fff !important; + --yt-spec-text-primary: #fff; --yt-spec-text-primary-inverse: #003459 !important; --yt-spec-text-secondary: #fff !important; --yt-spec-text-disabled: #fff !important; @@ -1593,7 +1595,7 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc --yt-spec-general-background-b: #c7efcf !important; --yt-spec-general-background-c: #c7efcf !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #666 !important; + --yt-spec-text-primary: #666; --yt-spec-text-primary-inverse: #d3e1c6 !important; --yt-spec-text-secondary: #666 !important; --yt-spec-text-disabled: #666 !important; @@ -1799,9 +1801,10 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc /*SUNSET*/ +html[it-theme=sunset] [dark], html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #2f3364 !important; --yt-swatch-primary-darker: #2f3364 !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -1822,7 +1825,7 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen --yt-spec-general-background-b: #2f3364 !important; --yt-spec-general-background-c: #2f3364 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #fff !important; + --yt-spec-text-primary: #fff; --yt-spec-text-primary-inverse: #283567 !important; --yt-spec-text-secondary: #fff !important; --yt-spec-text-disabled: #fff !important; @@ -2026,9 +2029,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen /*Fixing YT hardcoded CSS for DARK/light mode switching*/ -html:not([dark]) .yt-spec-icon-badge-shape, -html:not([dark]) .yt-spec-icon-badge-shape__icon .yt-spec-icon-shape { - color: var(--yt-spec-text-primary) !important; +.yt-spec-icon-shape { + color: var(--yt-spec-text-primary); } html[dark] .yt-spec-icon-badge-shape--style-overlay .yt-spec-icon-badge-shape__icon, @@ -2036,12 +2038,17 @@ html[dark] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text, html:not([dark]) .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text { color: var(--yt-spec-text-primary); } -html[it-theme="black"] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html[it-theme=black] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html[it-theme=sunset] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html[it-theme=night] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html[it-theme=dawn] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, html[dark] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { color: var(--yt-spec-text-primary); background-color: rgba(255, 255, 255, 0.1); } -html:not([dark]):not([it-theme="black"]) .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { +html[it-theme=desert] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html[it-theme=plain] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html:not([dark]):not([it-theme=black]):not([it-theme=sunset]):not([it-theme=night]):not([it-theme=dawn]) .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { color: var(--yt-spec-text-primary); background-color: rgba(0, 0, 0, 0.05); } From 28179868bb3629cd43ae488d3f6e41cdbdb725d2 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 9 Apr 2024 16:45:52 +0200 Subject: [PATCH 22/94] Update styles.css always override video description text --- js&css/extension/www.youtube.com/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index a1aa4c601..77eb09372 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -641,7 +641,7 @@ html[it-theme=night] #cinematics {mix-blend-mode: lighten !important} html[it-theme=plain] #cinematics {filter:invert(100%) !important; mix-blend-mode: darken !important} /*video detail text color. Fix. Themes didnt apply video description text color*/ -html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} +html[it-theme] .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string__link--call-to-action-color {color: var(--yt-spec-call-to-action)} /*The next two lines below can be removed if exact theming consistency isn't the goal and we just want to keep it simple.*/ html[it-theme]:not([it-theme=default]):not([it-theme=dark]) a.yt-simple-endpoint.yt-formatted-string {color: var(--yt-spec-call-to-action) !important} From d547665e8e49d5d31a602ba8a65bac2e7dd07a9d Mon Sep 17 00:00:00 2001 From: daveamit1 <18bce012@nirmauni.ac.in> Date: Tue, 9 Apr 2024 21:45:33 -0600 Subject: [PATCH 23/94] Added Fix for buttons below the player --- .../appearance/details/details.css | 50 +++++++++---------- js&css/web-accessible/functions.js | 9 ++-- .../www.youtube.com/appearance.js | 22 ++++---- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/js&css/extension/www.youtube.com/appearance/details/details.css b/js&css/extension/www.youtube.com/appearance/details/details.css index 8a0a0371a..cf136f0fd 100644 --- a/js&css/extension/www.youtube.com/appearance/details/details.css +++ b/js&css/extension/www.youtube.com/appearance/details/details.css @@ -8,8 +8,8 @@ /*-------------------------------------------------------------- YouTube's Detail Buttons --------------------------------------------------------------*/ -html[it-youtubeDetailButtons='hide_labels'] #subscribe-button .cbox, -html[it-youtubeDetailButtons='hide_labels'] #menu ytd-button-renderer div:nth-child(2) {visibility:hidden} +html[it-youtubeDetailButtons='hide_labels'] #subscribe-button .yt-spec-button-shape-next__button-text-content, +html[it-youtubeDetailButtons='hide_labels'] #menu button div:nth-child(2) {visibility:hidden} html[it-youtubeDetailButtons='half_transparent'] #subscribe-button button, html[it-youtubeDetailButtons='half_transparent'] #menu button {opacity:0.5;} html[it-youtubeDetailButtons='transparent_background'] #subscribe-button button, @@ -23,9 +23,9 @@ html[it-subscribe='transparent'] #subscribe-button button {background-color:rgba /* DISPLAY: NONE: */ html[it-subscribe='remove_label'] #subscribe-button button .yt-spec-button-shape-next__button-text-content, html[it-subscribe='hidden'] #subscribe-button, -html[it-youtubeDetailButtons='remove_labels'] #menu ytd-button-renderer div:nth-child(2), -html[it-youtubeDetailButtons='remove_labels'] #menu ytd-button-renderer .cbox, -html[it-youtubeDetailButtons='remove_labels'] #subscribe-button .cbox, +html[it-youtubeDetailButtons='remove_labels'] #menu button div:nth-child(2), +html[it-youtubeDetailButtons='remove_labels'] #menu button .yt-spec-button-shape-next__button-text-content, +html[it-youtubeDetailButtons='remove_labels'] #subscribe-button .yt-spec-button-shape-next__button-text-content, html[it-youtubeDetailButtons='remove'] #menu button, html[it-youtubeDetailButtons='remove'] #subscribe-button button, html[it-youtubeDetailButtons='remove_icons'] #menu button div:first-child, @@ -37,40 +37,40 @@ html[it-hide-dislike-button='hidden'] dislike-button-view-model, html[it-hide-dislike-button='icons_only'] dislike-button-view-model .yt-spec-button-shape-next__button-text-content, /*previous:*/ html[it-likes='hidden'] #top-level-buttons-computed #segmented-like-button ytd-toggle-button-renderer, -html[it-likes='icons_only'] #top-level-buttons-computed #segmented-like-button ytd-toggle-button-renderer div.cbox, +html[it-likes='icons_only'] #top-level-buttons-computed #segmented-like-button ytd-toggle-button-renderer div.yt-spec-button-shape-next__button-text-content, html[it-likes='icons_only'] #top-level-buttons-computed #segmented-like-button ytd-toggle-button-renderer yt-animated-rolling-number, html[it-likes='icons_only'] #top-level-buttons-computed #segmented-like-button ytd-toggle-button-renderer .yt-spec-button-shape-next__button-text-content, html[it-hide-dislike-button='hidden'] #top-level-buttons-computed #segmented-dislike-button ytd-toggle-button-renderer, -html[it-hide-dislike-button='icons_only'] #top-level-buttons-computed #segmented-dislike-button ytd-toggle-button-renderer div.cbox, +html[it-hide-dislike-button='icons_only'] #top-level-buttons-computed #segmented-dislike-button ytd-toggle-button-renderer div.yt-spec-button-shape-next__button-text-content, html[it-hide-dislike-button='icons_only'] #top-level-buttons-computed #segmented-dislike-button ytd-toggle-button-renderer yt-animated-rolling-number, html[it-hide-dislike-button='icons_only'] #top-level-buttons-computed #segmented-dislike-button ytd-toggle-button-renderer .yt-spec-button-shape-next__button-text-content, /*------# HIDE SHARE BUTTON------*/ html[it-hide-share-button='hidden'] #menu button:has(svg path[d^="M15 5.63 20.66"]), html[it-hide-share-button='hidden'] #flexible-item-buttons button:has(svg path[d^="M15 5.63 20.66"]), -html[it-hide-share-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M15 5.63 20.66"]) div:nth-child(2), -html[it-hide-share-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M15 5.63 20.66"]) .cbox, +html[it-hide-share-button='icons_only'] #menu button:has(svg path[d^="M15 5.63 20.66"]) div:nth-child(2), +html[it-hide-share-button='icons_only'] #menu button:has(svg path[d^="M15 5.63 20.66"]) .yt-spec-button-shape-next__button-text-content, /*------# HIDE DOWNLOAD BUTTON------*/ html[it-hide-download-button='hidden'] #menu button:has(svg path[d^="M17 18v1H6v-1h11"]), html[it-hide-download-button='hidden'] #flexible-item-buttons button:has(svg path[d^="M17 18v1H6v-1h11"]), -html[it-hide-download-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M17 18v1H6v-1h11"]) div:nth-child(2), -html[it-hide-download-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M17 18v1H6v-1h11"]) .cbox, +html[it-hide-download-button='icons_only'] #menu button:has(svg path[d^="M17 18v1H6v-1h11"]) div:nth-child(2), +html[it-hide-download-button='icons_only'] #menu button:has(svg path[d^="M17 18v1H6v-1h11"]) .yt-spec-button-shape-next__button-text-content, /*------# HIDE THANKS BUTTON------*/ html[it-hide-thanks-button='hidden'] #menu button:has(svg path[d^="M11 17h2v-1h1c.55 0"]), html[it-hide-thanks-button='hidden'] #flexible-item-buttons button:has(svg path[d^="M11 17h2v-1h1c.55 0"]), -html[it-hide-thanks-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M11 17h2v-1h1c.55 0"]) div:nth-child(2), -html[it-hide-thanks-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M11 17h2v-1h1c.55 0"]) .cbox, +html[it-hide-thanks-button='icons_only'] #menu button:has(svg path[d^="M11 17h2v-1h1c.55 0"]) div:nth-child(2), +html[it-hide-thanks-button='icons_only'] #menu button:has(svg path[d^="M11 17h2v-1h1c.55 0"]) .yt-spec-button-shape-next__button-text-content, /*------# HIDE CLIP BUTTON------*/ html[it-hide-clip-button='hidden'] #menu button:has(svg path[d^="M8 7c0 .55-.45 1-1"]), html[it-hide-clip-button='hidden'] #flexible-item-buttons button:has(svg path[d^="M8 7c0 .55-.45 1-1"]), -html[it-hide-clip-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M8 7c0 .55-.45 1-1"]) div:nth-child(2), -html[it-hide-clip-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M8 7c0 .55-.45 1-1"]) .cbox, +html[it-hide-clip-button='icons_only'] #menu button:has(svg path[d^="M8 7c0 .55-.45 1-1"]) div:nth-child(2), +html[it-hide-clip-button='icons_only'] #menu button:has(svg path[d^="M8 7c0 .55-.45 1-1"]) .yt-spec-button-shape-next__button-text-content, /*------# HIDE SAVE BUTTON------*/ html[it-hide-save-button='hidden'] #menu button:has(svg path[d^="M22 13h-4v4h-2v-4h"]), html[it-hide-save-button='hidden'] #flexible-item-buttons button:has(svg path[d^="M22 13h-4v4h-2v-4h"]), -html[it-hide-save-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M22 13h-4v4h-2v-4h"]) div:nth-child(2), -html[it-hide-save-button='icons_only'] #menu ytd-button-renderer:has(svg path[d^="M22 13h-4v4h-2v-4h"]) .cbox, +html[it-hide-save-button='icons_only'] #menu button:has(svg path[d^="M22 13h-4v4h-2v-4h"]) div:nth-child(2), +html[it-hide-save-button='icons_only'] #menu button:has(svg path[d^="M22 13h-4v4h-2v-4h"]) .yt-spec-button-shape-next__button-text-content, /*------HIDE REPORT BUTTON------*/ -html[it-hide-report-button='true'] #top-level-buttons-computed ytd-button-renderer#Report-button, +html[it-hide-report-button='true'] #top-level-buttons-computed button#Report-button, html[it-hide-report-button='true'] #menu button:has(svg path[d^="m13.18 4 .24 1.2.16.8H19v7h-5.18l-.24-1.2-.16-.8H6V4h7.18M14"]), html[it-hide-report-button='true'] #flexible-item-buttons button:has(svg path[d^="m13.18 4 .24 1.2.16.8H19v7h-5.18l-.24-1.2-.16-.8H6V4h7.18M14"]), /*------HIDE MORE BUTTON------*/ @@ -78,14 +78,14 @@ html[it-hide-more-button='true'] #menu yt-button-shape#button-shape, html[it-hide-more-button='true'] #menu button:has(svg path[d^="M7.5,12c0,0.83-0.67,1.5-1.5"]), html[it-hide-more-button='true'] #flexible-item-buttons button:has(svg path[d^="M7.5,12c0,0.83-0.67,1.5-1.5"]), /*------# HIDE THANKS BUTTON------*/ -html[it-hide-thanks-button='hidden'] #flexible-item-buttons ytd-button-renderer#Thanks-button, -html[it-hide-thanks-button='icons_only'] #flexible-item-buttons ytd-button-renderer#Thanks-button div.cbox, - /*------# HIDE CLIP BUTTON------*/ -html[it-hide-clip-button='hidden'] #flexible-item-buttons ytd-button-renderer#Clip-button, -html[it-hide-clip-button='icons_only'] #flexible-item-buttons ytd-button-renderer#Clip-button div.cbox, +/*html[it-hide-thanks-button='hidden'] #flexible-item-buttons button#Thanks-button, +html[it-hide-thanks-button='icons_only'] #flexible-item-buttons button#Thanks-button div.yt-spec-button-shape-next__button-text-content, +*/ /*------# HIDE CLIP BUTTON------*/ +html[it-hide-clip-button='hidden'] #flexible-item-buttons button#Clip-button, +html[it-hide-clip-button='icons_only'] #flexible-item-buttons button#Clip-button div.yt-spec-button-shape-next__button-text-content, /*------# HIDE SAVE BUTTON------*/ -html[it-hide-save-button='hidden'] #flexible-item-buttons ytd-button-renderer#Save-button, -html[it-hide-save-button='icons_only'] #flexible-item-buttons ytd-button-renderer#Save-button div.cbox +html[it-hide-save-button='hidden'] #flexible-item-buttons button#Save-button, +html[it-hide-save-button='icons_only'] #flexible-item-buttons button#Save-button div.yt-spec-button-shape-next__button-text-content /*=================================*/ {display: none;} /*---------------------------------*/ diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index efd7d6881..6e36fd346 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -132,10 +132,11 @@ ImprovedTube.ytElementsHandler = function (node) { this.howLongAgoTheVideoWasUploaded(); this.channelVideosCount(); } - } else if (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-video-primary-info-renderer')) { - if (document.documentElement.dataset.pageType === 'video') { - this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); - } + } + // else if (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-video-primary-info-renderer')) { + // if (document.documentElement.dataset.pageType === 'video') { + // this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); + // } } else if (name === 'YTD-PLAYLIST-HEADER-RENDERER' || (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-playlist-panel-renderer'))) { this.playlistPopupUpdate(); } else if (name === 'YTD-SUBSCRIBE-BUTTON-RENDERER') { diff --git a/js&css/web-accessible/www.youtube.com/appearance.js b/js&css/web-accessible/www.youtube.com/appearance.js index 359f01195..40a6b44bb 100644 --- a/js&css/web-accessible/www.youtube.com/appearance.js +++ b/js&css/web-accessible/www.youtube.com/appearance.js @@ -424,17 +424,17 @@ ImprovedTube.expandDescription = function (el) { /*------------------------------------------------------------------------------ HIDE DETAIL BUTTON ------------------------------------------------------------------------------*/ -ImprovedTube.hideDetailButton = function (el) { - if (el.length === 4) { - el[3].setAttribute("id", "Save-button"); - el[2].setAttribute("id", "Clip-button"); - el[1].setAttribute("id", "Thanks-button"); - } - else if (el.length === 3) { - el[2].setAttribute("id", "Save-button"); - el[1].setAttribute("id", "Clip-button"); - } -}; +// ImprovedTube.hideDetailButton = function (el) { +// if (el.length === 4) { +// el[3].setAttribute("id", "Save-button"); +// el[2].setAttribute("id", "Clip-button"); +// el[1].setAttribute("id", "Thanks-button"); +// } +// else if (el.length === 3) { +// el[2].setAttribute("id", "Save-button"); +// el[1].setAttribute("id", "Clip-button"); +// } +// }; /*-------------------------------------------------------------- DAY OF WEEK --------------------------------------------------------------*/ From bea69b08e0f1c90b1ae5d2c028d247b36c0bf92d Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 10 Apr 2024 16:04:43 +0200 Subject: [PATCH 24/94] Update functions.js any user click, not just precise click on the play icon --- js&css/web-accessible/functions.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index efd7d6881..1afa6682e 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -446,16 +446,7 @@ ImprovedTube.onkeydown = function () { ImprovedTube.onmousedown = function (event) { window.addEventListener('mousedown', function (event) { if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { - var path = event.composedPath(); - - for (var i = 0, l = path.length; i < l; i++) { - if (path[i].className - && path[i].className.indexOf - && (path[i].className.indexOf('html5-main-video') !== -1 - || path[i].className.indexOf('ytp-play-button') !== -1)) { - ImprovedTube.user_interacted = true; - } - } + ImprovedTube.user_interacted = true; } }, true); }; From 8a70c1719de3e5a8f7297ee95ace99ce0832cb41 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 10 Apr 2024 21:35:41 +0200 Subject: [PATCH 25/94] Update core.js limit localstorage writes to only essential ones currently we are writing on every page load, and its my fault :( --- js&css/web-accessible/core.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js&css/web-accessible/core.js b/js&css/web-accessible/core.js index 290e92db2..631d436a0 100644 --- a/js&css/web-accessible/core.js +++ b/js&css/web-accessible/core.js @@ -155,15 +155,20 @@ document.addEventListener('it-message-from-extension', function () { ImprovedTube.storage = message.storage; if (ImprovedTube.storage.block_vp9 || ImprovedTube.storage.block_av1 || ImprovedTube.storage.block_h264) { - let atlas = {block_vp9:'vp9|vp09', block_h264:'avc1', block_av1:'av01'} - localStorage['it-codec'] = Object.keys(atlas).reduce(function (all, key) { + let atlas = {block_vp9:'vp9|vp09', block_h264:'avc1', block_av1:'av01'}, + codec = Object.keys(atlas).reduce(function (all, key) { return ImprovedTube.storage[key] ? ((all?all+'|':'') + atlas[key]) : all}, ''); - } else { + if (localStorage['it-codec'] != codec) { + localStorage['it-codec'] = codec; + } + } else if (localStorage['it-codec']) { localStorage.removeItem('it-codec'); } if (ImprovedTube.storage.player_60fps === false) { - localStorage['it-player30fps'] = true; - } else { + if (!localStorage['it-player30fps']) { + localStorage['it-player30fps'] = true; + } + } else if (localStorage['it-player30fps']) { localStorage.removeItem('it-player30fps'); } From 65bfc3396d2766e5de6101fcee8dfcdc427aa300 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Thu, 11 Apr 2024 10:45:03 +0200 Subject: [PATCH 26/94] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e5952976e..6687f7250 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: '' -labels: Bug, Feature request, good first issue, help wanted, up-for-grabs +labels: Bug, good first issue, help wanted, up-for-grabs assignees: '' --- From bdacf0d5d3e98547f5e0c9ab185aef209fdb02a0 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Fri, 12 Apr 2024 05:20:52 +0200 Subject: [PATCH 27/94] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6687f7250..22079ecf1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,7 +11,7 @@ assignees: '' ⚬ **BUG**: ⚬ Browser: ⚬ **HOW**: - ⚬ Does the bug not happen when you log out of YouTube? - Then please copy the html source you get with ctrl+U. ) - Same if YouTube changed at all? then please paste check your 800+ experiment flags. - Enter yt.config_.EXPERIMENT_FLAGS into the Browser console (F12-Key) + ⚬ Does the bug not happen when you log out of YouTube? Or did YouTube change at all? - Then please check your 800+ experiment flags list with and without the error: Enter: yt.config_.EXPERIMENT_FLAGS into the Browser console on youtube (F12-Key). (Messy alternative: Copy the html-source you get with ctrl+U.) ⚬ *Or* did our last update start the bug? ⚬ Are any *Browser console errors shown? `F12`-key ⚬ ImprovedTube Version: From 8c8ce9504abd71095e8c24265a5dce939e89600b Mon Sep 17 00:00:00 2001 From: Alan Tan Date: Sat, 13 Apr 2024 20:45:54 +0800 Subject: [PATCH 28/94] minor fix --- js&css/web-accessible/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 6e36fd346..8c9cd7ebf 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -132,12 +132,12 @@ ImprovedTube.ytElementsHandler = function (node) { this.howLongAgoTheVideoWasUploaded(); this.channelVideosCount(); } - } + } // else if (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-video-primary-info-renderer')) { // if (document.documentElement.dataset.pageType === 'video') { // this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); // } - } else if (name === 'YTD-PLAYLIST-HEADER-RENDERER' || (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-playlist-panel-renderer'))) { + else if (name === 'YTD-PLAYLIST-HEADER-RENDERER' || (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-playlist-panel-renderer'))) { this.playlistPopupUpdate(); } else if (name === 'YTD-SUBSCRIBE-BUTTON-RENDERER') { if (node.className.indexOf('ytd-c4-tabbed-header-renderer') !== -1) { From c111e2bfa28bf48fa100c5e241799d3f4a724f87 Mon Sep 17 00:00:00 2001 From: Tobias Neumann Date: Fri, 19 Apr 2024 20:33:47 +0200 Subject: [PATCH 29/94] Fix Live Chat hiding once storage loaded --- js&css/web-accessible/functions.js | 6 +++--- js&css/web-accessible/init.js | 1 + js&css/web-accessible/www.youtube.com/appearance.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 8c9cd7ebf..e8e911871 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -145,9 +145,9 @@ ImprovedTube.ytElementsHandler = function (node) { } ImprovedTube.elements.subscribe_button = node; - } else if (id === 'show-hide-button') { - this.elements.livechat.button = document.querySelector('[aria-label="Hide chat"]'); - // console.log(document.querySelector('[aria-label="Hide chat"]')) + } else if (id === 'chat-messages') { + this.elements.livechat.button = document.querySelector('[aria-label="Close"]'); + // console.log(document.querySelector('[aria-label="Close"]')) this.livechat(); } else if (name === 'YTD-MASTHEAD') { if (!this.elements.masthead) { diff --git a/js&css/web-accessible/init.js b/js&css/web-accessible/init.js index 7075fe315..1f1462ea7 100644 --- a/js&css/web-accessible/init.js +++ b/js&css/web-accessible/init.js @@ -101,6 +101,7 @@ ImprovedTube.init = function () { this.youtubeLanguage(); this.myColors(); this.channelCompactTheme(); + this.livechat(); if (ImprovedTube.elements.player && ImprovedTube.elements.player.setPlaybackRate) { ImprovedTube.videoPageUpdate(); diff --git a/js&css/web-accessible/www.youtube.com/appearance.js b/js&css/web-accessible/www.youtube.com/appearance.js index 40a6b44bb..3ff50a80e 100644 --- a/js&css/web-accessible/www.youtube.com/appearance.js +++ b/js&css/web-accessible/www.youtube.com/appearance.js @@ -303,12 +303,12 @@ el.querySelector('*[target-id*=chapters]')?.removeAttribute('visibility');} } ------------------------------------------------------------------------------*/ ImprovedTube.livechat = function () { if (this.storage.livechat === "collapsed") { - if (typeof isCollapsed === 'undefined') { var isCollapsed = false; } + if (typeof isCollapsed === 'undefined') { var isCollapsed = false; } if(ImprovedTube.elements.livechat && !isCollapsed){ ImprovedTube.elements.livechat.button.click(); isCollapsed = true } - } /* else{ + } /* else{ if(isCollapsed){ ImprovedTube.elements.livechat.button.click(); isCollapsed = false From 5629b12e89436c2f679c23299640087c9a84670e Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 20 Apr 2024 04:27:30 +0200 Subject: [PATCH 30/94] Update styles.css adding .yt-video-attribute-view-model__title --- js&css/extension/www.youtube.com/styles.css | 37 ++++++++++----------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index 77eb09372..66677d2cf 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -2027,30 +2027,28 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen --yt-lightsource-secondary-title-color: var(--yt-spec-text-secondary) !important; } -/*Fixing YT hardcoded CSS for DARK/light mode switching*/ - -.yt-spec-icon-shape { - color: var(--yt-spec-text-primary); -} +/*------------------------------------------------------------------------------ +YT hardcoded CSS for DARK/light mode switching +Need HTML in front to make CSS rule more specific than one they are overiding +------------------------------------------------------------------------------*/ -html[dark] .yt-spec-icon-badge-shape--style-overlay .yt-spec-icon-badge-shape__icon, -html[dark] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text, -html:not([dark]) .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text { +html .yt-spec-icon-shape, +html .yt-spec-icon-badge-shape--style-overlay .yt-spec-icon-badge-shape__icon, +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text, +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html .yt-video-attribute-view-model__title { color: var(--yt-spec-text-primary); } -html[it-theme=black] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, -html[it-theme=sunset] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, -html[it-theme=night] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, -html[it-theme=dawn] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, -html[dark] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { - color: var(--yt-spec-text-primary); + +/*Dark colors get highlight*/ +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { background-color: rgba(255, 255, 255, 0.1); } +/*Light colors get shadow, overrides above highlight*/ html[it-theme=desert] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, html[it-theme=plain] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, html:not([dark]):not([it-theme=black]):not([it-theme=sunset]):not([it-theme=night]):not([it-theme=dawn]) .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { - color: var(--yt-spec-text-primary); - background-color: rgba(0, 0, 0, 0.05); + background-color: rgba(0, 0, 0, 0.05) !important; } /*subscribe button when not subscribed*/ @@ -2061,12 +2059,11 @@ html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--filled { /*override bell and thumbs up icons hardcoded colors inside SVG data*/ /*bell icon*/ -html .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="1"], -html:not([dark]) .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="1"] { +html .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="1"] { fill: var(--yt-spec-text-primary); } + /*thumbs up icon*/ -html .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="0"], -html:not([dark]) .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="0"] { +html .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="0"] { stroke: var(--yt-spec-text-primary); } From 94fdab3cec6e5f0e3180c85ec47a328b47a353d8 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 20 Apr 2024 04:47:07 +0200 Subject: [PATCH 31/94] Update styles.css formatting reformatted cinematics so its clearer what is happening. rejuggled rest of selectors to always tart with it-theme, added last missing [dark] --- js&css/extension/www.youtube.com/styles.css | 130 +++++++++++--------- 1 file changed, 69 insertions(+), 61 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index 66677d2cf..860d07d1d 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -634,11 +634,18 @@ ytd-guide-section-renderer .it-button::after { ------------------------------------------------------------------------------*/ /*update: cinematics */ html[it-theme=black] #cinematics, -html[it-theme=desert] #cinematics {display:none !important} +html[it-theme=desert] #cinematics { + display:none !important +} html[it-theme=dawn] #cinematics, html[it-theme=sunset] #cinematics, -html[it-theme=night] #cinematics {mix-blend-mode: lighten !important} -html[it-theme=plain] #cinematics {filter:invert(100%) !important; mix-blend-mode: darken !important} +html[it-theme=night] #cinematics { + mix-blend-mode: lighten !important +} +html[it-theme=plain] #cinematics { + filter:invert(100%) !important; + mix-blend-mode: darken !important +} /*video detail text color. Fix. Themes didnt apply video description text color*/ html[it-theme] .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} @@ -651,9 +658,10 @@ html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed- /*BLACK*/ +html[it-theme=black] [dark], html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #000 !important; --yt-swatch-primary-darker: #000 !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -706,15 +714,15 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { -webkit-filter: grayscale(1) brightness(3.5); filter: grayscale(1) brightness(3.5); } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #000 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -727,8 +735,8 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #000; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -742,8 +750,8 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); --ytd-searchbox-background: #000; @@ -871,8 +879,8 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(18,24,24,1.000) !important; --yt-lightsource-section3-color: rgba(20,30,30,1.000) !important; --yt-lightsource-section4-color: rgba(24,38,38,1.000) !important; @@ -938,8 +946,8 @@ html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #835 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -955,8 +963,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #d44d5c; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -970,8 +978,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); --ytd-searchbox-background: #672c3b; @@ -1100,15 +1108,15 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { -webkit-filter: grayscale(1) brightness(4); filter: grayscale(1) brightness(4); } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.2) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.3) !important; @@ -1119,8 +1127,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference /*DESERT*/ html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light] { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #faf9f9 !important; --yt-swatch-primary-darker: #faf9f9 !important; --yt-swatch-text: #555 !important; @@ -1173,8 +1181,8 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen } html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #ced3cb !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1190,8 +1198,8 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen } html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #faf9f9; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: #555; @@ -1205,8 +1213,8 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark]:not(.style-scope)[dark], -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light]:not(.style-scope)[dark] { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not(.style-scope)[dark], +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light]:not(.style-scope)[dark] { --yt-spec-icon-inactive: #555; --yt-spec-text-primary: #555; --ytd-searchbox-border-color: #555; @@ -1393,15 +1401,15 @@ html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peferenc } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { -webkit-filter: grayscale(1) brightness(3.5); filter: grayscale(1) brightness(3.5); } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #007ea7 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1417,8 +1425,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #003459; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -1432,8 +1440,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); --ytd-searchbox-background: #003459; @@ -1561,8 +1569,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.2) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.3) !important; @@ -1573,8 +1581,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc /*PLAIN*/ html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light] { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #c7efcf !important; --yt-swatch-primary-darker: #c7efcf !important; --yt-swatch-text: #666 !important; @@ -1627,8 +1635,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc } html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #e4ccaa !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1644,8 +1652,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc } html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #c7efcf; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -1659,8 +1667,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #666; --yt-spec-text-primary: #666; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); @@ -1789,8 +1797,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc } html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.05) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.15) !important; @@ -1857,8 +1865,8 @@ html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peferen } html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #f56258 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1874,8 +1882,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen } html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #2f3364; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -1889,8 +1897,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark]:not(.style-scope)[dark], -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light]:not(.style-scope)[dark] { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not(.style-scope)[dark], +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light]:not(.style-scope)[dark] { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); --ytd-searchbox-background: #fa7965; @@ -2018,8 +2026,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen } html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.2) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.3) !important; From 75e2b30fb9b58f1351f297fc28925e764c59f1ad Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 20 Apr 2024 07:07:00 +0200 Subject: [PATCH 32/94] Update functions.js catch html5-video-container, not just html5-main-video --- js&css/web-accessible/functions.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 1afa6682e..ba9ec1ca0 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -446,7 +446,16 @@ ImprovedTube.onkeydown = function () { ImprovedTube.onmousedown = function (event) { window.addEventListener('mousedown', function (event) { if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { - ImprovedTube.user_interacted = true; + var path = event.composedPath(); + + for (var i = 0, l = path.length; i < l; i++) { + if (path[i].className + && path[i].className.indexOf + && (path[i].className.indexOf('html5-video-container') !== -1 + || path[i].className.indexOf('ytp-play-button') !== -1)) { + ImprovedTube.user_interacted = true; + } + } } }, true); }; From c9de91c334897799e3c84278b96f2bbfcb1ab251 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 21 Apr 2024 06:26:23 +0200 Subject: [PATCH 33/94] Update general.css selector typo --- js&css/extension/www.youtube.com/general/general.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js&css/extension/www.youtube.com/general/general.css b/js&css/extension/www.youtube.com/general/general.css index 439c59d90..eb5551d50 100644 --- a/js&css/extension/www.youtube.com/general/general.css +++ b/js&css/extension/www.youtube.com/general/general.css @@ -65,7 +65,7 @@ html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-video-ren html[it-pathname='/feed/trending'][it-remove-trending-shorts="true"] ytd-rich-section-renderer:has(ytd-rich-grid-slim-media[is-short]), html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-rich-section-renderer:has(ytd-rich-grid-slim-media[is-short]), -html[it-pathnam='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer span#title:contains("Shorts"), +html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer span#title:contains("Shorts"), html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer path[d^="M17.77,10.32l-1.2-.5L18,9.06a3.74,3.74"], html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer span#title:contains('Trending Shorts'), html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer yt-horizontal-list-renderer, From 51233c57f94ffc8c58b540a39577a33e3b906596 Mon Sep 17 00:00:00 2001 From: Eleftheria Tsakanika <118540876+PTheocharis@users.noreply.github.com> Date: Sun, 21 Apr 2024 20:12:48 +0300 Subject: [PATCH 34/94] Final sole commit of greek translations --- _locales/el/messages.json | 513 +++++++++++++++++++++++++++++++++----- 1 file changed, 456 insertions(+), 57 deletions(-) diff --git a/_locales/el/messages.json b/_locales/el/messages.json index 1e8066947..be6aaf47f 100644 --- a/_locales/el/messages.json +++ b/_locales/el/messages.json @@ -12,7 +12,7 @@ "message": "Ενεργοποίηση Υπότιτλων" }, "activated": { - "message": "Ενεργοποιήθηκε" + "message": "Επιτυχής Ενεργοποιήση" }, "activatedFeatures": { "message": "Ενεργοποιημένες Λειτουργίες" @@ -24,7 +24,7 @@ "message": "Ενεργές λειτουργίες" }, "addScrollToTop": { - "message": "Πρόσθεσε συντόμευση για την κορυφή της σελίδας" + "message": "Πρόσθεση συντόμευσης για την κορυφή της σελίδας" }, "ads": { "message": "Διαφημίσεις" @@ -35,8 +35,14 @@ "allow": { "message": "Αποδοχή" }, + "Allow_auto_generate": { + "message": "Ενεργοποίηση αυτόματης δημιουργίας" + }, "allow60fps": { - "message": "Επίτρεψε 60fps" + "message": "Ενεργοποίηση 60fps" + }, + "always": { + "message": "Πάντα" }, "alwaysActive": { "message": "Πάντοτε ενεργό" @@ -50,11 +56,18 @@ "analyzer": { "message": "Αναλυτής" }, + "animations": { + "message": "Animations-Κινούμενα σχέδια" + }, "appearance": { "message": "Εμφάνιση" }, "areYouSureYouWantToImportTheData": { - "message": "Are you sure you want to import the data?" + "message": "Είστε σίγουρος/η ότι θέλετε να εισαγάγετε τα δεδομένα;" + }, + + "areYouSureYouWantToSyncTheData": { + "message": "Είστε σίγουρος/η ότι θέλετε να συγχρονίσετε τα δεδομένα;" }, "audio": { "message": "Ήχος" @@ -71,9 +84,21 @@ "autopauseWhenSwitchingTabs": { "message": "Αυτόματη παύση όταν αλλάζετε καρτέλα" }, + "autoPictureInPicture": { + "message": "Αυτόματη Picture In Picture (PiP)" + }, "autoplay": { "message": "Αυτόματη αναπαραγωγή" }, + "autoplayDisable": { + "message": "Απενεργοποίηση αυτόματης αναπαραγωγής" + }, + "backgroundColor": { + "message": "Χρώμα φόντου" + }, + "backgroundOpacity": { + "message": "Διαφάνεια φόντου" + }, "backupAndReset": { "message": "Αντίγραφα ασφαλείας & reset" }, @@ -87,11 +112,14 @@ "message": "Μαύρο" }, "blockAll": { - "message": "Αποκλείστε όλα" + "message": "Απκλεισμός όλων" }, "blocklist": { "message": "Λίστα αποκλεισμού" }, + "blockMusic": { + "message": "Παράκαμψη κατά την αναπαραγωγή μουσική" + }, "blue": { "message": "Μπλε" }, @@ -104,6 +132,9 @@ "brown": { "message": "Καφέ" }, + "browserAccountSync": { + "message": "Συγχρονισμός λογαριασμού με browser" + }, "browserVersion": { "message": "Έκδοση browser" }, @@ -128,23 +159,47 @@ "channels": { "message": "Κανάλια" }, + "chapters": { + "message": "Κεφάλαια" + }, + "characterEdgeStyle": { + "message": "Στυλ άκρων χαρακτήρων" + }, + "clip": { + "message": "Κλιπ" + }, "collapsed": { "message": "Κλειστό" }, "collapseOfSubscriptionSections": { - "message": "Κλείσε το μενού συνδρομών" + "message": "Σύμπτυξη μενού συνδρομών" }, - "comments": { + "comment": { "message": "Σχόλιο" }, + "comments": { + "message": "Σχόλια" + }, + "community": { + "message": "Κοινότητα" + }, + "compactTheme": { + "message": "Συμπαγές θεματικό" + }, "confirmationBeforeClosing": { - "message": "Επιβεβαίωση πρωτού κλείσεις" + "message": "Επιβεβαίωση πριν την αποχώρηση" }, "cores": { "message": "Πυρήνες" }, "cropChapterTitles": { - "message": "Περίκοψε τους τίτλους των κεφαλαίων" + "message": "Περίκοπη τίτλων των κεφαλαίων του player" + }, + "Currently_requiring_a_YouTube_API_key": { + "message": "Προς το παρόν απαιτείται κλειδί API του YouTube" + }, + "custom": { + "message": "Προσαρμοσμένο" }, "customCss": { "message": "Εξατομίκευση CSS" @@ -171,10 +226,13 @@ "message": "Αυγή" }, "decreasePlaybackSpeed": { - "message": "Μείωσε ταχύτητα αναπαραγωγής" + "message": "Μείωση ταχύτητας αναπαραγωγής" }, "decreaseVolume": { - "message": "Μειώστε ένταση" + "message": "Μειώση έντασης" + }, + "default": { + "message": "Προεπιλογή" }, "deepOrange": { "message": "Βαθύ πορτοκαλί" @@ -185,8 +243,14 @@ "defaultChannelTab": { "message": "Προεπιλεγμένη καρτέλα καναλιού" }, + "deleteWatchedVideos": { + "message": "Διαγραφή Ιστορικού παρακολούθησης" + }, "deleteYoutubeCookies": { - "message": "Κατάργησε τα cookies του YouTube" + "message": "Κατάργηση Youtube cookies" + }, + "description": { + "message": "Περιγραφή" }, "desert": { "message": "Έρημος" @@ -206,18 +270,36 @@ "disabled": { "message": "Απενεργοποιημένο" }, + "disableThumbnailPlayback": { + "message": "Απενεργοποίηση αναπαραγωγής εικονιδίων" + }, "dislike": { "message": "Δε μου αρέσει" }, + "displayDayOfTheWeak": { + "message": "Εμφάνιση ημέρας της εβδομάδας" + }, "doNotChange": { "message": "Να μην αλλάξει" }, + "Download": { + "message": "Λήψη" + }, "draggable": { "message": "Μετακινήσιμο με σύρση" }, + "durationWithSpeed": { + "message": "Εμφάνιση υπολειπόμενης διάρκειας με σχέση προς την ταχύτητα αναπαραγωγής" + }, "empty": { "message": "Κενό" }, + "Embedded_YouTube": { + "message": "Ενσωματωμένο YouTube" + }, + "embedded_Hide_Share": { + "message": "Απόκρυψη κοινοποίησης σε ενσωματωμένο βίντεο" + }, "enabled": { "message": "Ενεργοποιημένο" }, @@ -233,6 +315,15 @@ "extension": { "message": "Επέκταση" }, + "ExtraButtons": { + "message": "Επιπρόσθετα κουμπιά" + }, + "extraButtonsBelowThePlayer": { + "message": "Πρόσθετα κουμπιά κάτω από τον παίκτη" + }, + "Feature not yet available": { + "message": "Η λειτουργία δεν είναι διαθέσιμη ακόμα" + }, "file": { "message": "Αρχείο" }, @@ -240,11 +331,26 @@ "message": "Φίλτρα" }, "fitToWindow": { - "message": "Να χωράει στο παράθυρο" + "message": "Προσαρμογή στο παράθυρο" + }, + "Focus": { + "message": "Εστίαση" }, "font": { "message": "Γραμματοσειρά" }, + "fontColor": { + "message": "Χρώμα γραμματοσειράς" + }, + "fontFamily": { + "message": "Οικογένεια γραμματοσειράς" + }, + "fontOpacity": { + "message": "Διαφάνεια γραμματοσειράς" + }, + "fontSize": { + "message": "Μέγεθος γραμματοσειράς" + }, "footer": { "message": "Υποσέλιδο" }, @@ -252,7 +358,10 @@ "message": "Υποχρεωτική ταχύτητα αναπαραγωγής" }, "forcedPlayVideoFromTheBeginning": { - "message": "Forced play video from the beginning" + "message": "Επιβολή αναπαραγωγής βίντεο από την αρχή" + }, + "forcedPlaybackSpeedMusic": { + "message": "Επιβολή ταχύτητας αναπαραγωγής για μουσική" }, "forcedTheaterMode": { "message": "Υποχρεωτική λειτουργία κινηματογράφου" @@ -260,6 +369,9 @@ "forcedVolume": { "message": "Υποχρεωτική ένταση" }, + "forceSDR": { + "message": "Επιβολή SDR" + }, "foundABug": { "message": "Εντοπίσατε κάποιο σφάλμα;" }, @@ -275,12 +387,27 @@ "green": { "message": "Πράσινο" }, + "grey": { + "message": "Γκρι" + }, + "halfTransparent": { + "message": "Ημι-αχνό" + }, + "Hamburger_Menu": { + "message": "Μενού hamburger" + }, + "hardwareInformation": { + "message": "Πληροφορίες hardware" + }, "hdThumbnail": { "message": "HD Εικονίδιο βίντεο" }, "header": { "message": "Κεφαλίδα" }, + "hd": { + "message": "HD-Υψηλή ευκρίνεια" + }, "hidden": { "message": "Κρυμμένο" }, @@ -288,52 +415,106 @@ "message": "Κρυμμένο στη σελίδα βίντεο" }, "hideAnimatedThumbnails": { - "message": "Απόκρυψε τα κινούμενα εικονίδια βίντεο" + "message": "Απόκρυψη κινούμενων εικονιδίων" }, "hideAnnotations": { - "message": "Απόκρυψε τα annotations" + "message": "Απόκρυψη των annotations" + }, + "hide_author_avatars": { + "message": "Απόκρυψη εικονιδίου συγγραφέα" }, "hideCards": { - "message": "Απόκρυψε τις κάρτες" + "message": "Απόκρυψη καρτών" + }, + "hideCategories": { + "message": "Απόκρυψη κατηγοριών" + }, + "hideCommentsCount": { + "message": "Απόκρυψη μετρητή σχολίων" + }, + "hideCountryCode": { + "message": "Απόκρυψη κωδικού χώρας" + }, + "hideDate": { + "message": "Απόκρυψη ημερομηνίας" + }, + "hideDetailButton": { + "message": "Απόκρυψη κουμπιού λεπτομερειών" }, "hideDetails": { - "message": "Απόκρυψε τις λεπτομέρειες" + "message": "Απόκρυψη λεπτομερειών" }, "hideEndscreen": { - "message": "Απόκρυψε την κάρτα τέλους" + "message": "Απόκρυψη τελικής οθόνης" }, "hideFeaturedContent": { - "message": "Απόκρυψε το προτεινόμενο περιεχόμενο" + "message": "Απόκρυψη προτεινόμενου περιεχομένου" }, "hideFooter": { - "message": "Απόκρυψε το υποσέλιδο" + "message": "Απόκρυψη υποσέλιδου" }, "hideGradientBottom": { - "message": "Απόκρυψε το κάτω μέρος της χρωματικής διαβάθμισης" + "message": "Απόκρυψη κάτω μέρους της χρωματικής διαβάθμισης" }, "hideHomePageShorts": { - "message": "Κατάργηση Shorts από την αρχική σελίδα" + "message": "Απόκρυψη Shorts από την αρχική σελίδα" + }, + "hide_Labels": { + "message": "Απόκρυψη ετικετών" + }, + "hideMore": { + "message": "Απόκρυψη περισσότερων" + }, + "Hide_Pause_Overlay": { + "message": "Απόκρυψη επικάλυψης παύσης" + }, + "hidePlayerControlsBar": { + "message": "Απόκρυψη γραμμής ελέγχου παίκτη" }, "hidePlayerControlsBarButtons": { - "message": "Hide player controls bar buttons" + "message": "Απόκρυψη κουμπιών γραμμής ελέγχου παίκτη" }, "hidePlaylist": { - "message": "Απόκρυψε τα playlists" + "message": "Απόκρυψη λιστών αναπαραγωγής" + }, + "hideReport": { + "message": "Απόκρυψη αναφοράς" }, "hideRightButtons": { - "message": "Απόκρυψε τα κουμπιά στα δεξιά" + "message": "Απόκρυψη δεξιών κουμπιών" }, "hideScrollForDetails": { - "message": "Απόκρυψε το «Scroll for details»" + "message": "Απόκρυψη του «Scroll for details»" + }, + "Hide_Shorts_remixing_this_video": { + "message": "Απόκρυψη remixing Shorts του βίντεο" + }, + "Hide_sidebar": { + "message": "Απόκρυψη πλαϊνής στήλης" }, "hideSkipOverlay": { - "message": "Hide Skip Overlay" + "message": "Απόκρυψη επικάλυψης παράβλεψης" + }, + "Hide_the_tabs_only": { + "message": "Απόκρυψη μόνο των tabs" }, "hideThumbnailOverlay": { - "message": "Hide thumbnail overlay" + "message": "Απόκρυψη επικάλυψης εικονιδίων" + }, + "hideThumbnails": { + "message": "Απόκρυψη εικονιδίων(Thumbnails)" }, "hideViewsCount": { - "message": "Απόκρυψε τον αριθμό προβολών" + "message": "Απόκρυψη αριθμού προβολών" + }, + "hideVoiceSearchButton": { + "message": "Απόκρυψη κουμπιού αναζήτησης φωνής" + }, + "Hide_YouTube_Logo": { + "message": "Απόκρυψη λογότυπου του YouTube" + }, + "high": { + "message": "Υψηλή" }, "history": { "message": "Ιστορικό" @@ -341,6 +522,9 @@ "home": { "message": "Αρχική σελίδα" }, + "homeScreen": { + "message": "Αρχική οθόνη" + }, "hover": { "message": "Κέρσορας από πάνω" }, @@ -348,7 +532,7 @@ "message": "Κέρσορας πάνω στη σελίδα βίντεο" }, "howLongAgoTheVideoWasUploaded": { - "message": "Πριν από πόσο ανέβηκε το βίντεο" + "message": "Διάρκεια ανάρτησης του βιντεο" }, "icons": { "message": "Εικονίδια" @@ -380,12 +564,24 @@ "items": { "message": "Αντικείμενα" }, + "language": { + "message": "Γλώσσα" + }, "languages": { "message": "Γλώσσες" }, "legacyYoutube": { "message": "Παλιά έκδοση YouTube" }, + "layout": { + "message": "Διάταξη" + }, + "layerAnimationScale": { + "message": "Κλίμακα κινούμενου επιπέδου" + }, + "library": { + "message": "Βιβλιοθήκη" + }, "light": { "message": "Ανοιχτόχρωμο" }, @@ -398,24 +594,57 @@ "like": { "message": "Μου αρέσει" }, + "liked": { + "message": "Βίντεο που μου αρέσουν" + }, "lime": { "message": "Μοσχολέμονο" }, "list": { "message": "Λίστα" }, + "liveChat": { + "message": "Live συνομιλία" + }, "liveChatType": { - "message": "Τύπος live chat" + "message": "Τύπος Live συνομιλίας" + }, + "loop": { + "message": "Επανάληψη" }, "loudnessNormalization": { "message": "Κανονικοποίηση έντασης" }, + "low": { + "message": "Χαμηλή" + }, "markWatchedVideos": { "message": "Επισήμανση βίντεο που προβλήθηκαν" }, + "Max. width within the page": { + "message": "Μέγ. πλάτος εντός της σελίδας" + }, + "medium": { + "message": "Μεσαία" + }, + "more": { + "message": "Περισσότερα" + }, + "mostViewedChannels": { + "message": "Kανάλια με τις περισσότερες προβολές" + }, + "moveSidebarLeft": { + "message": "Μετακίνηση πλαϊνής στήλης προς τα αριστερά" + }, + "moveThumbnailsRight": { + "message": "Μετακίνηση εικονιδιών (Thumbnails) προς τα δεξιά" + }, "myColors": { "message": "Τα χρώματά μου" }, + "My_specs": { + "message": "Προδιαγραφές" + }, "name": { "message": "Όνομα" }, @@ -438,14 +667,20 @@ "message": "Κανένα" }, "noOpenVideoTabs": { - "message": "Καμία καρτέλα βίντεο ανοικτή" + "message": "Καμία άλλη καρτέλα βίντεο ανοικτή" }, "normal": { "message": "Κανονικό" }, + "off": { + "message": "Απενεργοποιημένο" + }, "old": { "message": "Παλιό" }, + "onSmallCreators": { + "message": "Μόνο για μικρά κανάλια" + }, "onAllVideos": { "message": "Σε όλα τα βίντεο" }, @@ -458,6 +693,15 @@ "onSubscribedChannels": { "message": "Σε κανάλια που έχει γίνει συνδρομή" }, + "openNewTab":{ + "message": "Άνοιξε σε νέα σελίδα" + }, + "Optimize Codec for hardware acceleration": { + "message": "Βελτιστοποίηση κωδικοποιητή για επιτάχυνση υλικού" + }, + "optimizeForHardwareAcceleration": { + "message": "Βελτιστοποίηση για επιτάχυνση υλικού" + }, "orange": { "message": "Πορτοκαλί" }, @@ -476,15 +720,45 @@ "platform": { "message": "Πλατφόρμα" }, + "playAllButton": { + "message": "Κουμπί αναπαραγωγής όλων" + }, "playbackSpeed": { "message": "Ταχύτητα αναπαραγωγής" }, + "player_auto_cinema_mode": { + "message": "Αυτόματη λειτουργία κινηματογράφου" + }, + "player_auto_hide_cinema_mode_when_paused": { + "message": "Αυτόματη απόκρυψη λειτουργίας κινηματογράφου κατά την παύση" + }, + "player_autoplay_disable": { + "message": "Απενεργοποίηση αυτόματης αναπαραγωγής" + }, + "player_auplayer_SDR": { + "message": "Αυτόματη επαναλαμβανόμενη λειτουργία SDR" + }, + "player_cinema_mode_button": { + "message": "Κουμπί λειτουργίας κινηματογράφου" + }, "playerColor": { - "message": "Χρώμσ player" + "message": "Χρώμα player" + }, + "player_dont_speed_education": { + "message": "Μη επιβολή ταχύτητας εκπαίδευσης" + }, + "player_fit_to_win_button": { + "message": "Κουμπί προσαρμογής στο παράθυρο" + }, + "playPause": { + "message": "Αναπαραγωγή/Παύση" }, "playerSize": { "message": "Μέγεθος player" }, + "popupWindowButtons": { + "message": "Κουμπιά pop up παραθύρου" + }, "position": { "message": "Θέση" }, @@ -500,9 +774,15 @@ "primaryColor": { "message": "Πρωτεύον χρώμα" }, + "pullSyncSettings": { + "message": "Επανάκτηση ρυθμίσεων συγχρονισμού-Pull" + }, "purple": { "message": "Μοβ" }, + "pushSyncSettings": { + "message": "Μεταφορά ρυθμίσεων συγχρονισμού-Push" + }, "quality": { "message": "Ποιότητα" }, @@ -513,20 +793,41 @@ "message": "Κόκκινο" }, "redDislikeButton": { - "message": "Δείξτε το πλήκτρο «Δε μου αρέσει» σε κόκκινο" + "message": "Μετατροπή «Δε μου αρέσει» σε κόκκινο" }, "relatedVideos": { "message": "Σχετικά videos" }, + "remote": { + "message": "Παίξε στην TV" + }, + "remove": { + "message": "Αφαίρεση" + }, + "removeBlackBars": { + "message": "Κατάργηση μαύρων μπαρών" + }, + "removeIcons": { + "message": "Αφαίρεση εικονιδίων" + }, + "removeName": { + "message": "Αφαίρεση ονόματος" + }, "removeRelatedSearchResults": { - "message": "Αφαίρεσε σχετικά αποτελέσματα αναζήτησης" + "message": "Αφαίρεση σχετικών αποτελεσμάτων αναζήτησης" + }, + "RemoveSubtitlesForLyrics": { + "message": "Κατάργηση υποτίτλων για στίχους" }, "removeShortsReelSearchResults": { - "message": "Αφαιρέστε τη λίστα Shorts από τα αποτελέσματα αναζήτησης" + "message": "Αφαίρεση της λίστας Shorts από τα αποτελέσματα αναζήτησης" }, "repeat": { "message": "Επανάληψη" }, + "report": { + "message": "Αναφορά" + }, "reset": { "message": "Επαναφορά" }, @@ -554,8 +855,14 @@ "screen": { "message": "Οθόνη" }, + "Screenshot": { + "message": "Στιγμιότυπο οθόνης" + }, "screenshot": { - "message": "Στιγμιότυπο" + "message": "Στιγμιότυπο οθόνης" + }, + "sd": { + "message": "SD-Κανονική ευκρίνεια" }, "search": { "message": "Αναζήτηση" @@ -570,10 +877,10 @@ "message": "Μπροστά 10 δευτερόλεπτα" }, "seekNextChapter": { - "message": "seekNextChapter" + "message": "Αναζήτηση επόμενου κεφαλαίου στο player" }, "seekPreviousChapter": { - "message": "seekPreviousChapter" + "message": "Αναζήτηση προηγούμενου κεφαλαίου" }, "settings": { "message": "Ρυθμίσεις" @@ -581,18 +888,43 @@ "settingsSuccessfullyImported": { "message": "Επιτυχής εισαγωγή ρυθμίσεων" }, + "share": { + "message": "Κοινοποίηση" + }, + "shortcut_chapters": { + "message": "Συντόμευση κεφαλαίων του player" + }, "shortcuts": { "message": "Συντομεύσεις" }, + "shorts": { + "message": "Shorts" + }, "showCardsOnMouseHover": { - "message": "Δείξε τις κάρτες όταν ο κέρσορας είναι από πάνω" + "message": "Εμφάνιση καρτών όταν ο κέρσορας είναι από πάνω" }, "showChannelVideosCount": { - "message": "Δείξε τις συνολικές προβολές του καναλιού" + "message": "Εμφάνιση συνολικών προβολών του καναλιού" + }, + "showRemainingDuration": { + "message": "Εμφάνιση υπολειπόμενης διάρκειας" + }, + "showVersion": { + "message": "Εμφάνιση έκδοσης" }, "shuffle": { "message": "Τυχαία αναπαραγωγή" }, + "sidebar": { + "message": "Πλαϊνή στήλη" + }, + "Sidebar_simple_alternative": { + "message": "Απλή εναλλακτική πλαϊνή στήλη" + }, + + "softwareInformation": { + "message": "Πληροφορίες λογισμικού" + }, "squaredUserImages": { "message": "Τετράγωνες εικόνες χρήστη" }, @@ -600,13 +932,13 @@ "message": "Στατικό" }, "statsForNerds": { - "message": "Δείξε τα Στατιστικά για Σπασίκλες" + "message": "Στατιστικά για Σπασίκλες" }, "step": { "message": "Βήμα" }, "stop": { - "message": "Στοπ" + "message": "Διακοπή" }, "style": { "message": "Στυλ" @@ -614,12 +946,19 @@ "styles": { "message": "Στυλ" }, + "subscribe": { + "message": "Συνδρομή" + }, "subscriptions": { "message": "Συνδρομές" }, + "Subtitle_Capture_including_the_current_words": { + "message": "Καταγραφή υποτίτλων συμπεριλαμβανομένων των τρεχουσών λέξεων" + }, "subtitles": { "message": "Υπότιτλοι" }, + "sunset": { "message": "Ηλιοβασίλεμα" }, @@ -630,10 +969,10 @@ "message": "Προτίμηση συστήματος: Σκούρο" }, "systemPeferenceLight": { - "message": "Προτίμηση συστήματος: Ανοικτόχρωμο" + "message": "Προτίμηση συστήματος: Ανοιχτόχρωμο" }, "teal": { - "message": "Γαλαζιοπράσινο" + "message": "Γαλαζοπράσινο" }, "textColor": { "message": "Χρώμα κειμένου" @@ -642,19 +981,25 @@ "message": "Θέματα" }, "thisWillRemoveAllCookies": { - "message": "Αυτό αφαιρεί όλα τα cookies." + "message": "Αφαίρεση όλων των cookies." + }, + "thisWillRemoveAllWatchedVideos": { + "message": "Διαγραφή ολόκληρου του Ιστορικού παρακολούθησης" }, "thisWillRemoveAllYouTubeCookies": { - "message": "Αυτό αφαιρεί όλα τα cookies του YouTube." + "message": "Aφαίρεση των Youtube cookies." }, "thisWillResetAllSettings": { - "message": "Αυτό επαναφέρει όλες τις ρυθμίσεις." + "message": "Επαναφορά Ρυθμίσεων" }, "thisWillResetAllShortcuts": { - "message": "Αυτό επαναφέρει όλες τις συντομεύσεις." + "message": "Eπαναφορά όλων των συντομεύσεων." }, "thumbnails": { - "message": "Εικονίδια" + "message": "Εικονίδια των Βιντεο-Μικρογραφίες" + }, + "thumbnailsQuality": { + "message": "Ποιότητα εικονιδίων" }, "timeFrom": { "message": "Χρόνος από" @@ -662,23 +1007,53 @@ "timeTo": { "message": "Χρόνος έως" }, + "Titles": { + "message": "Τίτλοι" + }, "todayAt": { "message": "Σήμερα στις" }, + "toggleAutoplay": { + "message": "Εναλλαγή αυτόματης αναπαραγωγής" + }, + "toggleCards": { + "message": "Εναλλαγή καρτών" + }, "toggleControls": { - "message": "Toggle controls" + "message": "Eναλλαγή των controls" + }, + "To_the_side_No_page_margin": { + "message": "Προς τα πλάγια χωρίς περιθώρια σελίδας" + }, + "trackWatchedVideos": { + "message": "Καταγραφή πληροφοριών Ιστορικού παρακολούθησης" + }, + "trailerAutoplay": { + "message": "Αυτόματη αναπαραγωγή τρέιλερ" + }, + "transcript": { + "message": "Αποσπάσματα" + }, + "Transcript": { + "message": "Αποσπάσματα" }, "translations": { "message": "Μεταφράσεις" }, "transparentBackground": { - "message": "Διαφανές υπόβαθρο" + "message": "Διαφανές φόντο" + }, + "TransparentBackground": { + "message": "Διαφανές φόντο" + }, + "transparentColor": { + "message": "Διαφανές χρώμα" }, "trending": { "message": "Τάσεις" }, "tryToReloadThePage": { - "message": "Προσπάθησε να επαναφορτώσεις τη σελίδα" + "message": "Προσπάθεια επαναφόρτωσης σελίδας" }, "type": { "message": "Τύπος" @@ -687,7 +1062,7 @@ "message": "Επόμενο στο autoplay" }, "use24HourFormat": { - "message": "Χρησιμοποίησε 24ωρη μορφή ώρας" + "message": "Χρήση κανονικής 24ώρης μορφής ώρας" }, "version": { "message": "Έκδοση" @@ -704,24 +1079,45 @@ "videos": { "message": "Βίντεο" }, + "viewMode": { + "message": "Λειτουργία προβολής" + }, "volume": { "message": "Ένταση" }, + "watchedVideos": { + "message": "Ιστορικό παρακολούθησης" + }, "watchLater": { - "message": "Δες αργότερα" + "message": "Προβολή αργότερα" }, "watchTime": { "message": "Χρόνος προβολής" }, + "whenPaused": { + "message": "Κατά την παύση" + }, "whenTabIsChanged": { - "message": "Όταν αλλάζεις καρτέλα" + "message": "Κατά την αλλαγή καρτέλας" }, "white": { "message": "Λευκό" }, + "windowColor": { + "message": "Χρώμα παραθύρου" + }, + "windowOpacity": { + "message": "Διαφάνεια παραθύρου" + }, + "with_scrollbars": { + "message": "Με scrollbar" + }, "yellow": { "message": "Κίτρινο" }, + "youTubeButtons": { + "message": "YouTube-Κουμπιά" + }, "youtubeHeaderLeft": { "message": "Κεφαλίδα YouTube (αριστερά)" }, @@ -736,5 +1132,8 @@ }, "youtubeLimitsVideoQualityTo1080pForH264Codec": { "message": "Το YouTube περιορίζει την ποιότητα σε 1080p για το h.264 codec" + }, + "Youtube_Search": { + "message": "Youtube-Αναζήτηση" } } \ No newline at end of file From 52f3d7e2df5d1cecceb10c64378c02050e177a8a Mon Sep 17 00:00:00 2001 From: Eleftheria Tsakanika <118540876+PTheocharis@users.noreply.github.com> Date: Sun, 21 Apr 2024 21:52:49 +0300 Subject: [PATCH 35/94] Final greek translations --- _locales/el/messages.json | 1063 +++++++++++++++++++++---------------- 1 file changed, 600 insertions(+), 463 deletions(-) diff --git a/_locales/el/messages.json b/_locales/el/messages.json index be6aaf47f..4d9c4b059 100644 --- a/_locales/el/messages.json +++ b/_locales/el/messages.json @@ -1,1139 +1,1276 @@ { - "about": { - "message": "Σχετικά" - }, - "accept": { - "message": "Αποδοχή" - }, - "activate": { - "message": "Ενεργοποίηση" - }, - "activateCaptions": { - "message": "Ενεργοποίηση Υπότιτλων" - }, - "activated": { - "message": "Επιτυχής Ενεργοποιήση" - }, - "activatedFeatures": { - "message": "Ενεργοποιημένες Λειτουργίες" - }, - "activateFullscreen": { - "message": "Ενεργοποίηση Πλήρους Οθόνη" - }, - "activeFeatures": { - "message": "Ενεργές λειτουργίες" - }, - "addScrollToTop": { - "message": "Πρόσθεση συντόμευσης για την κορυφή της σελίδας" - }, - "ads": { - "message": "Διαφημίσεις" - }, - "all": { - "message": "Όλα" - }, - "allow": { - "message": "Αποδοχή" - }, - "Allow_auto_generate": { - "message": "Ενεργοποίηση αυτόματης δημιουργίας" - }, - "allow60fps": { - "message": "Ενεργοποίηση 60fps" - }, - "always": { - "message": "Πάντα" - }, - "alwaysActive": { - "message": "Πάντοτε ενεργό" - }, - "alwaysShowProgressBar": { - "message": "Πάντα ορατός ο ενδείκτης προόδου" - }, - "amber": { - "message": "Κεχρί" - }, - "analyzer": { - "message": "Αναλυτής" - }, - "animations": { - "message": "Animations-Κινούμενα σχέδια" - }, - "appearance": { - "message": "Εμφάνιση" - }, - "areYouSureYouWantToImportTheData": { - "message": "Είστε σίγουρος/η ότι θέλετε να εισαγάγετε τα δεδομένα;" - }, - - "areYouSureYouWantToSyncTheData": { - "message": "Είστε σίγουρος/η ότι θέλετε να συγχρονίσετε τα δεδομένα;" - }, - "audio": { - "message": "Ήχος" - }, - "audioFormats": { - "message": "Μορφές ήχου" - }, - "auto": { - "message": "Αυτόματο" - }, - "autoFullscreen": { - "message": "Αυτόματη Πλήρης Οθόνη" - }, - "autopauseWhenSwitchingTabs": { - "message": "Αυτόματη παύση όταν αλλάζετε καρτέλα" - }, - "autoPictureInPicture": { - "message": "Αυτόματη Picture In Picture (PiP)" - }, - "autoplay": { - "message": "Αυτόματη αναπαραγωγή" - }, - "autoplayDisable": { - "message": "Απενεργοποίηση αυτόματης αναπαραγωγής" + "about": { + "message": "Σχετικά" + }, + "accept": { + "message": "Αποδοχή" + }, + "activate": { + "message": "Ενεργοποίηση" + }, + "activateCaptions": { + "message": "Ενεργοποίηση Υπότιτλων" + }, + "activated": { + "message": "Επιτυχής Ενεργοποιήση" + }, + "activatedFeatures": { + "message": "Ενεργοποιημένες Λειτουργίες" + }, + "activateFullscreen": { + "message": "Ενεργοποίηση Πλήρους Οθόνη" + }, + "activeFeatures": { + "message": "Ενεργές λειτουργίες" + }, + "addScrollToTop": { + "message": "Πρόσθεση συντόμευσης για την κορυφή της σελίδας" + }, + "ads": { + "message": "Διαφημίσεις" + }, + "all": { + "message": "Όλα" + }, + "allow": { + "message": "Αποδοχή" + }, + "Allow_auto_generate": { + "message": "Ενεργοποίηση αυτόματης δημιουργίας" + }, + "allow60fps": { + "message": "Ενεργοποίηση 60fps" + }, + "allYourSettingsWillBeErasedAndCanTBeRecovered": { + "message": "Όλες οι ρυθμίσεις σας θα διαγραφούν και δεν μπορούν να ανακτηθούν" + }, + "allYourShortcutsWillBeErasedAndCanTBeRecovered": { + "message": "Όλες οι συντομεύσεις σας θα διαγραφούν και δεν μπορούν να ανακτηθούν" + }, + "always": { + "message": "Πάντα" + }, + "alwaysActive": { + "message": "Πάντοτε ενεργό" + }, + "alwaysShowProgressBar": { + "message": "Πάντα ορατός ο ενδείκτης προόδου" + }, + "amber": { + "message": "Κεχρί" + }, + "analyzer": { + "message": "Αναλυτής" + }, + "animations": { + "message": "Animations-Κινούμενα σχέδια" + }, + "appearance": { + "message": "Εμφάνιση" + }, + "areYouSureYouWantToExportTheData": { + "message": "Είστε σίγουρος/η ότι θέλετε να εξάγετε τα δεδομένα;\n" + }, + "areYouSureYouWantToImportTheData": { + "message": "Είστε σίγουρος/η ότι θέλετε να εισαγάγετε τα δεδομένα;" + }, + "areYouSureYouWantToSyncTheData": { + "message": "Είστε σίγουρος/η ότι θέλετε να συγχρονίσετε τα δεδομένα;" + }, + "ARROWDOWN": { + "message": "⇩" + }, + "ARROWLEFT": { + "message": "⇦" + }, + "ARROWRIGHT": { + "message": "⇨" + }, + "ARROWUP": { + "message": "⇧" + }, + "atHistory": { + "message": "στο 'Ιστορικό'" + }, + "atSubscriptions": { + "message": "στις 'Συνδρομές'" + }, + "atTrending": { + "message": "στις 'Τάσεις'" + }, + "audio": { + "message": "Ήχος" + }, + "audioFormats": { + "message": "Μορφές ήχου" + }, + "auto": { + "message": "Αυτόματο" + }, + "autoFullscreen": { + "message": "Αυτόματη Πλήρης Οθόνη" + }, + "autopauseWhenSwitchingTabs": { + "message": "Αυτόματη παύση όταν αλλάζετε καρτέλα" + }, + "autoPictureInPicture": { + "message": "Αυτόματη Picture In Picture (PiP)" + }, + "autoplay": { + "message": "Αυτόματη αναπαραγωγή" + }, + "autoplayDisable": { + "message": "Απενεργοποίηση αυτόματης αναπαραγωγής" + }, + "avoidAv1": { + "message": "Αποφύγετε το AV1" + }, + "avoidAv1Vp8Vp9": { + "message": "Αποφύγετε το AV1, VP8, VP9" + }, + "avoidAv1Vp9": { + "message": "Αποφύγετε το AV1, VP9" + }, + "avoidCpuRenderingWhenPossible": { + "message": "Αποφύγετε τη CPU αποτύπωση όταν είναι δυνατόν" }, "backgroundColor": { - "message": "Χρώμα φόντου" + "message": "Χρώμα φόντου" }, "backgroundOpacity": { - "message": "Διαφάνεια φόντου" + "message": "Διαφάνεια φόντου" }, "backupAndReset": { - "message": "Αντίγραφα ασφαλείας & reset" + "message": "Αντίγραφα ασφαλείας & reset" }, "baseOnSystemColorScheme": { - "message": "Με βάση τις ρυθμίσεις χρώματος του συστήματος" + "message": "Με βάση τις ρυθμίσεις χρώματος του συστήματος" }, "belowPlayer": { - "message": "Κάτω από το Player" + "message": "Κάτω από το Player" }, "black": { - "message": "Μαύρο" + "message": "Μαύρο" + }, + "block_Codec_Alert_h264": { + "message": "Χρειάζεστε είτε το H.264 είτε το VP9 ενεργοποιημένο για να αναπαραχθούν βίντεο στο Youtube." + }, + "block_Codec_Alert_VP9": { + "message": "Χρειάζεστε είτε το VP9 είτε το H.264 ενεργοποιημένο για να αναπαραχθούν βίντεο στο Youtube." }, "blockAll": { - "message": "Απκλεισμός όλων" + "message": "Απενεργοποίηση (Αποκλεισμός ή Παράβλεψη)" }, "blocklist": { - "message": "Λίστα αποκλεισμού" + "message": "Λίστα αποκλεισμού" }, "blockMusic": { - "message": "Παράκαμψη κατά την αναπαραγωγή μουσική" + "message": "Παράκαμψη κατά την αναπαραγωγή μουσική" }, "blue": { - "message": "Μπλε" + "message": "Μπλε" }, "blueGray": { - "message": "Μπλε γκρίζο" + "message": "Μπλε γκρίζο" }, "bluelight": { - "message": "Μπλε φως" + "message": "Μπλε φως" }, "brown": { - "message": "Καφέ" + "message": "Καφέ" }, "browserAccountSync": { - "message": "Συγχρονισμός λογαριασμού με browser" + "message": "Συγχρονισμός λογαριασμού με browser" }, "browserVersion": { - "message": "Έκδοση browser" + "message": "Έκδοση browser" }, "bubbles": { - "message": "Φούσκες" + "message": "Φούσκες" }, "bug": { - "message": "Σφάλμα κώδικα" + "message": "Σφάλμα κώδικα" }, "buttons": { - "message": "Κουμπιά" + "message": "Κουμπιά" }, "cancel": { - "message": "Ακύρωση" + "message": "Ακύρωση" }, "categories": { - "message": "Κατηγορίες" + "message": "Κατηγορίες" }, "channel": { - "message": "Κανάλι" + "message": "Κανάλι" }, "channels": { - "message": "Κανάλια" + "message": "Κανάλια" }, "chapters": { - "message": "Κεφάλαια" + "message": "Κεφάλαια" }, "characterEdgeStyle": { - "message": "Στυλ άκρων χαρακτήρων" + "message": "Στυλ άκρων χαρακτήρων" }, "clip": { - "message": "Κλιπ" + "message": "Κλιπ" }, "collapsed": { - "message": "Κλειστό" + "message": "Κλειστό" }, "collapseOfSubscriptionSections": { - "message": "Σύμπτυξη μενού συνδρομών" + "message": "Σύμπτυξη μενού συνδρομών" + }, + "columns": { + "message": "Επιπλέον στήλη πλαϊνής μπάρας" }, "comment": { - "message": "Σχόλιο" + "message": "Σχόλιο" }, "comments": { - "message": "Σχόλια" + "message": "Σχόλια" }, "community": { - "message": "Κοινότητα" + "message": "Κοινότητα" + }, + "compact_spacing": { + "message": "Συμπαγής Διάταξη" }, "compactTheme": { - "message": "Συμπαγές θεματικό" + "message": "Συμπαγές θεματικό" }, "confirmationBeforeClosing": { - "message": "Επιβεβαίωση πριν την αποχώρηση" + "message": "Επιβεβαίωση πριν την αποχώρηση" }, "cores": { - "message": "Πυρήνες" + "message": "Πυρήνες" }, "cropChapterTitles": { - "message": "Περίκοπη τίτλων των κεφαλαίων του player" + "message": "Περίκοπη τίτλων των κεφαλαίων του player" }, "Currently_requiring_a_YouTube_API_key": { - "message": "Προς το παρόν απαιτείται κλειδί API του YouTube" + "message": "Προς το παρόν απαιτείται κλειδί API του YouTube" }, "custom": { - "message": "Προσαρμοσμένο" + "message": "Προσαρμοσμένο" }, "customCss": { - "message": "Εξατομίκευση CSS" + "message": "Εξατομίκευση CSS" }, "customJs": { - "message": "Εξατομίκευση JS" + "message": "Εξατομίκευση JS" }, "customMiniPlayer": { - "message": "Εξατομικευμένο Mini-Player" + "message": "Εξατομικευμένο Mini-Player" }, "cyan": { - "message": "Κυανό" + "message": "Κυανό" }, "dark": { - "message": "Σκούρο" + "message": "Σκούρο" }, "darkTheme": { - "message": "Σκούρο θέμα" + "message": "Σκούρο θέμα" }, "dateAndTime": { - "message": "Ημερομηνία & ώρα" + "message": "Ημερομηνία & ώρα" }, "dawn": { - "message": "Αυγή" + "message": "Αυγή" }, "decreasePlaybackSpeed": { - "message": "Μείωση ταχύτητας αναπαραγωγής" + "message": "Μείωση ταχύτητας αναπαραγωγής" }, "decreaseVolume": { - "message": "Μειώση έντασης" - }, - "default": { - "message": "Προεπιλογή" + "message": "Μειώση έντασης" }, "deepOrange": { - "message": "Βαθύ πορτοκαλί" + "message": "Βαθύ πορτοκαλί" }, "deepPurple": { - "message": "Βαθύ μοβ" + "message": "Βαθύ μοβ" + }, + "default": { + "message": "Προεπιλογή" + }, + "default_CC": { + "message": "Προεπιλογή" }, "defaultChannelTab": { - "message": "Προεπιλεγμένη καρτέλα καναλιού" + "message": "Προεπιλεγμένη καρτέλα καναλιού" + }, + "defaultContentCountry": { + "message": "Χώρα (ψηφιακή πλοήγηση)" + }, + "defaultPlaybackSpeed": { + "message": "Προεπιλεγμένη Ταχύτητα Αναπαραγωγής" + }, + "default_theme": { + "message": "Προεπιλογή" }, "deleteWatchedVideos": { - "message": "Διαγραφή Ιστορικού παρακολούθησης" + "message": "Διαγραφή Ιστορικού παρακολούθησης" }, "deleteYoutubeCookies": { - "message": "Κατάργηση Youtube cookies" + "message": "Κατάργηση Youtube cookies" }, "description": { - "message": "Περιγραφή" + "message": "Περιγραφή" + }, + "description_ext": { + "message": "YouTube, καθαρό + έξυπνο; Μέγεθος βίντεο Youtube player χρώμα Youtube ad παράβλεψης ταχύτητα έντασης ετικέτες παράβλεψης απόκρυψη λίστας" }, "desert": { - "message": "Έρημος" + "message": "Έρημος" }, "details": { - "message": "Λεπτομέρειες" + "message": "Λεπτομέρειες" }, "developerOptions": { - "message": "Επιλογές για προγραμματιστές" + "message": "Επιλογές για προγραμματιστές" }, "device": { - "message": "Συσκευή" + "message": "Συσκευή" }, "dim": { - "message": "Σκοτεινό" + "message": "Σκοτεινό" }, "disabled": { - "message": "Απενεργοποιημένο" + "message": "Απενεργοποιημένο" }, "disableThumbnailPlayback": { - "message": "Απενεργοποίηση αναπαραγωγής εικονιδίων" + "message": "Απενεργοποίηση αναπαραγωγής εικονιδίων" }, "dislike": { - "message": "Δε μου αρέσει" + "message": "Δε μου αρέσει" }, "displayDayOfTheWeak": { - "message": "Εμφάνιση ημέρας της εβδομάδας" + "message": "Εμφάνιση ημέρας της εβδομάδας" + }, + "donate": { + "message": "Δωρεά" }, "doNotChange": { - "message": "Να μην αλλάξει" + "message": "Να μην αλλάξει" }, "Download": { - "message": "Λήψη" + "message": "Λήψη" }, "draggable": { - "message": "Μετακινήσιμο με σύρση" + "message": "Μετακινήσιμο με σύρση" }, - "durationWithSpeed": { - "message": "Εμφάνιση υπολειπόμενης διάρκειας με σχέση προς την ταχύτητα αναπαραγωγής" + "dropShadow": { + "message": "Drop Επισκίαση" }, - "empty": { - "message": "Κενό" + "durationWithSpeed": { + "message": "Εμφάνιση υπολειπόμενης διάρκειας με σχέση προς την ταχύτητα αναπαραγωγής" }, "Embedded_YouTube": { - "message": "Ενσωματωμένο YouTube" + "message": "Ενσωματωμένο YouTube" }, "embedded_Hide_Share": { - "message": "Απόκρυψη κοινοποίησης σε ενσωματωμένο βίντεο" + "message": "Απόκρυψη κοινοποίησης σε ενσωματωμένο βίντεο" + }, + "empty": { + "message": "Κενό" }, "enabled": { - "message": "Ενεργοποιημένο" + "message": "Ενεργοποιημένο" }, "enabledForced": { - "message": "Ενεργοποιημένο (Υποχρεωτικά)" + "message": "Ενεργοποιημένο (Υποχρεωτικά)" }, "expanded": { - "message": "Ανοικτό" + "message": "Ανοικτό" }, "exportSettings": { - "message": "Εξαγωγή ρυθμίσεων" + "message": "Εξαγωγή ρυθμίσεων" }, "extension": { - "message": "Επέκταση" + "message": "Επέκταση" }, "ExtraButtons": { - "message": "Επιπρόσθετα κουμπιά" + "message": "Επιπρόσθετα κουμπιά" }, "extraButtonsBelowThePlayer": { - "message": "Πρόσθετα κουμπιά κάτω από τον παίκτη" + "message": "Πρόσθετα κουμπιά κάτω από τον παίκτη" }, - "Feature not yet available": { - "message": "Η λειτουργία δεν είναι διαθέσιμη ακόμα" + "Feature_not_yet_available": { + "message": "Η λειτουργία δεν είναι διαθέσιμη ακόμα" }, "file": { - "message": "Αρχείο" + "message": "Αρχείο" }, "filters": { - "message": "Φίλτρα" + "message": "Φίλτρα" }, "fitToWindow": { - "message": "Προσαρμογή στο παράθυρο" + "message": "Προσαρμογή στο παράθυρο" }, "Focus": { - "message": "Εστίαση" + "message": "Εστίαση" + }, + "flash": { + "message": "Flash" }, "font": { - "message": "Γραμματοσειρά" + "message": "Γραμματοσειρά" }, "fontColor": { - "message": "Χρώμα γραμματοσειράς" + "message": "Χρώμα γραμματοσειράς" }, "fontFamily": { - "message": "Οικογένεια γραμματοσειράς" + "message": "Οικογένεια γραμματοσειράς" }, "fontOpacity": { - "message": "Διαφάνεια γραμματοσειράς" + "message": "Διαφάνεια γραμματοσειράς" }, "fontSize": { - "message": "Μέγεθος γραμματοσειράς" + "message": "Μέγεθος γραμματοσειράς" }, "footer": { - "message": "Υποσέλιδο" + "message": "Υποσέλιδο" }, "forcedPlaybackSpeed": { - "message": "Υποχρεωτική ταχύτητα αναπαραγωγής" + "message": "Υποχρεωτική ταχύτητα αναπαραγωγής" }, "forcedPlayVideoFromTheBeginning": { - "message": "Επιβολή αναπαραγωγής βίντεο από την αρχή" + "message": "Επιβολή αναπαραγωγής βίντεο από την αρχή" }, "forcedPlaybackSpeedMusic": { - "message": "Επιβολή ταχύτητας αναπαραγωγής για μουσική" + "message": "Επιβολή ταχύτητας αναπαραγωγής για μουσική" }, "forcedTheaterMode": { - "message": "Υποχρεωτική λειτουργία κινηματογράφου" + "message": "Υποχρεωτική λειτουργία κινηματογράφου" }, "forcedVolume": { - "message": "Υποχρεωτική ένταση" + "message": "Υποχρεωτική ένταση" }, "forceSDR": { - "message": "Επιβολή SDR" + "message": "Επιβολή SDR" }, "foundABug": { - "message": "Εντοπίσατε κάποιο σφάλμα;" + "message": "Εντοπίσατε κάποιο σφάλμα;" }, "fullWindow": { - "message": "Πλήρες παράθυρο" + "message": "Πλήρες παράθυρο" }, "general": { - "message": "Γενικά" + "message": "Γενικά" + }, + "geoPreference": { + "message": "Προτίμηση Γεωγραφικού Χώρου" }, "goToSearchBox": { - "message": "Πήγαινε στο πεδίο αναζήτησης" + "message": "Πήγαινε στο πεδίο αναζήτησης" + }, + "GPUnotindatabase": { + "message": "GPU εκτός βάσης δεδομένων" }, "green": { - "message": "Πράσινο" + "message": "Πράσινο" }, "grey": { - "message": "Γκρι" + "message": "Γκρι" }, "halfTransparent": { - "message": "Ημι-αχνό" + "message": "Ημι-αχνό" }, "Hamburger_Menu": { - "message": "Μενού hamburger" + "message": "Μενού hamburger" }, "hardwareInformation": { - "message": "Πληροφορίες hardware" + "message": "Πληροφορίες hardware" + }, + "hd": { + "message": "HD-Υψηλή ευκρίνεια" }, "hdThumbnail": { - "message": "HD Εικονίδιο βίντεο" + "message": "HD Εικονίδιο βίντεο" }, "header": { - "message": "Κεφαλίδα" - }, - "hd": { - "message": "HD-Υψηλή ευκρίνεια" + "message": "Κεφαλίδα" }, "hidden": { - "message": "Κρυμμένο" + "message": "Κρυμμένο" }, "hiddenOnVideoPage": { - "message": "Κρυμμένο στη σελίδα βίντεο" + "message": "Κρυμμένο στη σελίδα βίντεο" + }, + "hide_author_avatars": { + "message": "Απόκρυψη εικονιδίου συγγραφέα" }, "hideAnimatedThumbnails": { - "message": "Απόκρυψη κινούμενων εικονιδίων" + "message": "Απόκρυψη κινούμενων εικονιδίων" }, "hideAnnotations": { - "message": "Απόκρυψη των annotations" - }, - "hide_author_avatars": { - "message": "Απόκρυψη εικονιδίου συγγραφέα" + "message": "Απόκρυψη των annotations" }, "hideCards": { - "message": "Απόκρυψη καρτών" + "message": "Απόκρυψη καρτών" }, "hideCategories": { - "message": "Απόκρυψη κατηγοριών" + "message": "Απόκρυψη κατηγοριών" }, "hideCommentsCount": { - "message": "Απόκρυψη μετρητή σχολίων" + "message": "Απόκρυψη μετρητή σχολίων" }, "hideCountryCode": { - "message": "Απόκρυψη κωδικού χώρας" + "message": "Απόκρυψη κωδικού χώρας" }, "hideDate": { - "message": "Απόκρυψη ημερομηνίας" + "message": "Απόκρυψη ημερομηνίας" }, "hideDetailButton": { - "message": "Απόκρυψη κουμπιού λεπτομερειών" + "message": "Απόκρυψη κουμπιού λεπτομερειών" }, "hideDetails": { - "message": "Απόκρυψη λεπτομερειών" + "message": "Απόκρυψη λεπτομερειών" }, "hideEndscreen": { - "message": "Απόκρυψη τελικής οθόνης" + "message": "Απόκρυψη τελικής οθόνης" }, "hideFeaturedContent": { - "message": "Απόκρυψη προτεινόμενου περιεχομένου" + "message": "Απόκρυψη προτεινόμενου περιεχομένου" }, "hideFooter": { - "message": "Απόκρυψη υποσέλιδου" + "message": "Απόκρυψη υποσέλιδου" }, "hideGradientBottom": { - "message": "Απόκρυψη κάτω μέρους της χρωματικής διαβάθμισης" + "message": "Απόκρυψη κάτω μέρους της χρωματικής διαβάθμισης" }, "hideHomePageShorts": { - "message": "Απόκρυψη Shorts από την αρχική σελίδα" + "message": "Απόκρυψη Shorts από την αρχική σελίδα" }, "hide_Labels": { - "message": "Απόκρυψη ετικετών" + "message": "Απόκρυψη ετικετών" }, "hideMore": { - "message": "Απόκρυψη περισσότερων" + "message": "Απόκρυψη περισσότερων" }, "Hide_Pause_Overlay": { - "message": "Απόκρυψη επικάλυψης παύσης" + "message": "Απόκρυψη επικάλυψης παύσης" }, "hidePlayerControlsBar": { - "message": "Απόκρυψη γραμμής ελέγχου παίκτη" + "message": "Απόκρυψη γραμμής ελέγχου player" }, "hidePlayerControlsBarButtons": { - "message": "Απόκρυψη κουμπιών γραμμής ελέγχου παίκτη" + "message": "Απόκρυψη κουμπιών γραμμής ελέγχου player" + }, + "hidePlayerControlsBarOptions": { + "message": "Απόκρυψη ελέγχου επιλογών player" }, "hidePlaylist": { - "message": "Απόκρυψη λιστών αναπαραγωγής" + "message": "Απόκρυψη playlist" }, "hideReport": { - "message": "Απόκρυψη αναφοράς" + "message": "Απόκρυψη αναφοράς" }, "hideRightButtons": { - "message": "Απόκρυψη δεξιών κουμπιών" + "message": "Απόκρυψη δεξιών κουμπιών" }, "hideScrollForDetails": { - "message": "Απόκρυψη του «Scroll for details»" + "message": "Απόκρυψη του «Scroll for details»" }, "Hide_Shorts_remixing_this_video": { - "message": "Απόκρυψη remixing Shorts του βίντεο" + "message": "Απόκρυψη remixing Shorts του βίντεο" }, "Hide_sidebar": { - "message": "Απόκρυψη πλαϊνής στήλης" + "message": "Απόκρυψη πλαϊνής στήλης" }, "hideSkipOverlay": { - "message": "Απόκρυψη επικάλυψης παράβλεψης" + "message": "Απόκρυψη επικάλυψης παράβλεψης" }, "Hide_the_tabs_only": { - "message": "Απόκρυψη μόνο των tabs" + "message": "Απόκρυψη μόνο των tabs" }, "hideThumbnailOverlay": { - "message": "Απόκρυψη επικάλυψης εικονιδίων" + "message": "Απόκρυψη επικάλυψης εικονιδίων" }, "hideThumbnails": { - "message": "Απόκρυψη εικονιδίων(Thumbnails)" + "message": "Απόκρυψη εικονιδίων(Thumbnails)" }, "hideViewsCount": { - "message": "Απόκρυψη αριθμού προβολών" + "message": "Απόκρυψη αριθμού προβολών" }, "hideVoiceSearchButton": { - "message": "Απόκρυψη κουμπιού αναζήτησης φωνής" + "message": "Απόκρυψη κουμπιού αναζήτησης φωνής" }, "Hide_YouTube_Logo": { - "message": "Απόκρυψη λογότυπου του YouTube" + "message": "Απόκρυψη λογότυπου του YouTube" }, "high": { - "message": "Υψηλή" + "message": "Υψηλή" }, "history": { - "message": "Ιστορικό" + "message": "Ιστορικό" }, "home": { - "message": "Αρχική σελίδα" + "message": "Αρχική σελίδα" }, "homeScreen": { - "message": "Αρχική οθόνη" + "message": "Αρχική οθόνη" }, "hover": { - "message": "Κέρσορας από πάνω" + "message": "Κέρσορας από πάνω" }, "hoverOnVideoPage": { - "message": "Κέρσορας πάνω στη σελίδα βίντεο" + "message": "Κέρσορας πάνω στη σελίδα βίντεο" }, "howLongAgoTheVideoWasUploaded": { - "message": "Διάρκεια ανάρτησης του βιντεο" + "message": "Διάρκεια ανάρτησης του βιντεο" }, "icons": { - "message": "Εικονίδια" + "message": "Εικονίδια" }, "iconsOnly": { - "message": "Εικονίδια μόνο" + "message": "Εικονίδια μόνο" }, "importSettings": { - "message": "Εισαγωγή ρυθμίσεων" + "message": "Εισαγωγή ρυθμίσεων" + }, + "improvedtubeButtons": { + "message": "ImprovedTube Κουμπιά" }, "improvedtubeIconOnYoutube": { - "message": "Εικονίδιο ImprovedTube στο YouTube" + "message": "Εικονίδιο ImprovedTube στο YouTube" }, "improvedtubeLanguage": { - "message": "Γλώσσα ImprovedTube" + "message": "Γλώσσα ImprovedTube" }, "improvedtubeVersion": { - "message": "Έκδοση ImprovedTube" + "message": "Έκδοση ImprovedTube" }, "improveLogo": { - "message": "Λογότυπο Improve" + "message": "Λογότυπο Improve" }, "increasePlaybackSpeed": { - "message": "Αύξησε την ταχύτητα αναπαραγωγής" + "message": "Αύξησε την ταχύτητα αναπαραγωγής" }, "increaseVolume": { - "message": "Αύξησε την ένταση" + "message": "Αύξησε την ένταση" }, "items": { - "message": "Αντικείμενα" + "message": "Αντικείμενα" }, "language": { - "message": "Γλώσσα" + "message": "Γλώσσα" + }, + "language_closed_caption": { + "message": "Προεπιλεγμένη γλώσσα - Κλειστά Captions" }, "languages": { - "message": "Γλώσσες" + "message": "Γλώσσες" }, "legacyYoutube": { - "message": "Παλιά έκδοση YouTube" - }, - "layout": { - "message": "Διάταξη" + "message": "Παλιά έκδοση YouTube" }, "layerAnimationScale": { - "message": "Κλίμακα κινούμενου επιπέδου" + "message": "Κλίμακα κινούμενου επιπέδου" + }, + "layout": { + "message": "Διάταξη" }, "library": { - "message": "Βιβλιοθήκη" + "message": "Βιβλιοθήκη" }, "light": { - "message": "Ανοιχτόχρωμο" + "message": "Ανοιχτόχρωμο" }, "lightBlue": { - "message": "Ανοικτό μπλε" + "message": "Ανοικτό μπλε" }, "lightGreen": { - "message": "Ανοικτό πράσινο" + "message": "Ανοικτό πράσινο" }, "like": { - "message": "Μου αρέσει" + "message": "Μου αρέσει" }, "liked": { - "message": "Βίντεο που μου αρέσουν" + "message": "Βίντεο που μου αρέσουν" + }, + "likes": { + "message": "Likes (Μου αρέσει)" }, "lime": { - "message": "Μοσχολέμονο" + "message": "Μοσχολέμονο" + }, + "limitPageWidth": { + "message": "Περιορισμός πλάτους σελίδας" }, "list": { - "message": "Λίστα" + "message": "Λίστα" }, "liveChat": { - "message": "Live συνομιλία" + "message": "Live συνομιλία" }, "liveChatType": { - "message": "Τύπος Live συνομιλίας" + "message": "Τύπος Live συνομιλίας" + }, + "location": { + "message": "Τοποθεσία" }, "loop": { - "message": "Επανάληψη" + "message": "Επανάληψη" }, "loudnessNormalization": { - "message": "Κανονικοποίηση έντασης" + "message": "Κανονικοποίηση έντασης" }, "low": { - "message": "Χαμηλή" + "message": "Χαμηλή" }, "markWatchedVideos": { - "message": "Επισήμανση βίντεο που προβλήθηκαν" + "message": "Επισήμανση βίντεο που προβλήθηκαν" }, "Max. width within the page": { - "message": "Μέγ. πλάτος εντός της σελίδας" + "message": "Μέγ. πλάτος εντός της σελίδας" }, "medium": { - "message": "Μεσαία" + "message": "Μεσαία" }, "more": { - "message": "Περισσότερα" + "message": "Περισσότερα" }, "mostViewedChannels": { - "message": "Kανάλια με τις περισσότερες προβολές" + "message": "Kανάλια με τις περισσότερες προβολές" }, "moveSidebarLeft": { - "message": "Μετακίνηση πλαϊνής στήλης προς τα αριστερά" + "message": "Μετακίνηση πλαϊνής στήλης προς τα αριστερά" }, "moveThumbnailsRight": { - "message": "Μετακίνηση εικονιδιών (Thumbnails) προς τα δεξιά" + "message": "Μετακίνηση εικονιδιών (Thumbnails) προς τα δεξιά" }, "myColors": { - "message": "Τα χρώματά μου" + "message": "Τα χρώματά μου" }, "My_specs": { - "message": "Προδιαγραφές" + "message": "Προδιαγραφές" }, "name": { - "message": "Όνομα" + "message": "Όνομα" }, "nativeMiniPlayer": { - "message": "Mini player συστήματος" + "message": "Mini player συστήματος" }, "new": { - "message": "Νέο" + "message": "Νέο" }, "nextVideo": { - "message": "Επόμενο βίντεο" + "message": "Επόμενο βίντεο" }, "night": { - "message": "Νύχτα" + "message": "Νύχτα" }, "noActiveFeatures": { - "message": "Καμία λειτουργία ενεργή" + "message": "Καμία λειτουργία ενεργή" }, "none": { - "message": "Κανένα" + "message": "Κανένα" }, "noOpenVideoTabs": { - "message": "Καμία άλλη καρτέλα βίντεο ανοικτή" + "message": "Καμία άλλη καρτέλα βίντεο ανοικτή" }, "normal": { - "message": "Κανονικό" + "message": "Κανονικό" + }, + "Not_optimal": { + "message": "Όχι βέλτιστο" }, "off": { - "message": "Απενεργοποιημένο" + "message": "Απενεργοποιημένο" }, "old": { - "message": "Παλιό" - }, - "onSmallCreators": { - "message": "Μόνο για μικρά κανάλια" + "message": "Παλιό" }, "onAllVideos": { - "message": "Σε όλα τα βίντεο" + "message": "Σε όλα τα βίντεο" }, "onlyActiveOnYoutube": { - "message": "Μόνο ενεργό στο YouTube" + "message": "Μόνο ενεργό στο YouTube" }, "onlyOnePlayerInstancePlaying": { - "message": "Μόνο ένα player λειτουργεί" + "message": "Μόνο ένα player λειτουργεί" + }, + "onSmallCreators": { + "message": "Μόνο για μικρά κανάλια" }, "onSubscribedChannels": { - "message": "Σε κανάλια που έχει γίνει συνδρομή" + "message": "Σε κανάλια που έχει γίνει συνδρομή" }, - "openNewTab":{ - "message": "Άνοιξε σε νέα σελίδα" + "openNewTab": { + "message": "Άνοιξε σε νέα σελίδα" }, - "Optimize Codec for hardware acceleration": { - "message": "Βελτιστοποίηση κωδικοποιητή για επιτάχυνση υλικού" + "openPopupPlayer": { + "message": "Άνοιξε το video/playlist σε νέο παράθυρο" }, - "optimizeForHardwareAcceleration": { - "message": "Βελτιστοποίηση για επιτάχυνση υλικού" + "optimizeCodecForHardwareAcceleration": { + "message": "Βελτιστοποίηση κωδικοποιητή για επιτάχυνση υλικού" }, "orange": { - "message": "Πορτοκαλί" + "message": "Πορτοκαλί" }, "other": { - "message": "Άλλο" + "message": "Άλλο" + }, + "outline": { + "message": "Περίγραμμα" + }, + "overlay": { + "message": "Επικάλυψη" }, "permissions": { - "message": "Άδεια" + "message": "Άδεια" }, "pink": { - "message": "Ροζ" + "message": "Ροζ" }, "plain": { - "message": "Σκέτο" + "message": "Σκέτο" }, "platform": { - "message": "Πλατφόρμα" + "message": "Πλατφόρμα" }, "playAllButton": { - "message": "Κουμπί αναπαραγωγής όλων" + "message": "Κουμπί αναπαραγωγής όλων" }, "playbackSpeed": { - "message": "Ταχύτητα αναπαραγωγής" + "message": "Ταχύτητα αναπαραγωγής" }, "player_auto_cinema_mode": { - "message": "Αυτόματη λειτουργία κινηματογράφου" + "message": "Αυτόματη λειτουργία κινηματογράφου" }, "player_auto_hide_cinema_mode_when_paused": { - "message": "Αυτόματη απόκρυψη λειτουργίας κινηματογράφου κατά την παύση" + "message": "Αυτόματη απόκρυψη λειτουργίας κινηματογράφου κατά την παύση" }, "player_autoplay_disable": { - "message": "Απενεργοποίηση αυτόματης αναπαραγωγής" + "message": "Απενεργοποίηση αυτόματης αναπαραγωγής" }, "player_auplayer_SDR": { - "message": "Αυτόματη επαναλαμβανόμενη λειτουργία SDR" + "message": "Αυτόματη επαναλαμβανόμενη λειτουργία SDR" }, "player_cinema_mode_button": { - "message": "Κουμπί λειτουργίας κινηματογράφου" - }, - "playerColor": { - "message": "Χρώμα player" + "message": "Κουμπί λειτουργίας κινηματογράφου" }, "player_dont_speed_education": { - "message": "Μη επιβολή ταχύτητας εκπαίδευσης" + "message": "Μη επιβολή ταχύτητας εκπαίδευσης" }, "player_fit_to_win_button": { - "message": "Κουμπί προσαρμογής στο παράθυρο" + "message": "Κουμπί προσαρμογής στο παράθυρο" }, - "playPause": { - "message": "Αναπαραγωγή/Παύση" + "player_rotate_button": { + "message": "Περιστροφή βίντεο" }, "playerSize": { - "message": "Μέγεθος player" + "message": "Μέγεθος player" + }, + "playerColor": { + "message": "Χρώμα γραμμής προόδου player" + }, + "playPause": { + "message": "Αναπαραγωγή/Παύση" }, "popupWindowButtons": { - "message": "Κουμπιά pop up παραθύρου" + "message": "Κουμπιά pop up παραθύρου" }, "position": { - "message": "Θέση" + "message": "Θέση" }, "pressAnyKeyOrScroll": { - "message": "Πίεσε οποιοδήποτε πλήκτρο ή χρησιμοποίησε τη ροδέλα στο ποντίκι." + "message": "Πίεσε οποιοδήποτε πλήκτρο ή χρησιμοποίησε τη ροδέλα στο ποντίκι." }, "pressAnyKeyOrUseMouseWheel": { - "message": "Πίεσε οποιοδήποτε πλήκτρο ή χρησιμοποίησε τη ροδέλα στο ποντίκι." + "message": "Πίεσε οποιοδήποτε πλήκτρο ή χρησιμοποίησε τη ροδέλα στο ποντίκι." }, "previousVideo": { - "message": "Προηγούμενο βίντεο" + "message": "Προηγούμενο βίντεο" }, "primaryColor": { - "message": "Πρωτεύον χρώμα" + "message": "Χρώμα γραμμής προόδου" }, "pullSyncSettings": { - "message": "Επανάκτηση ρυθμίσεων συγχρονισμού-Pull" + "message": "Επανάκτηση ρυθμίσεων συγχρονισμού-Pull" }, "purple": { - "message": "Μοβ" + "message": "Μοβ" }, "pushSyncSettings": { - "message": "Μεταφορά ρυθμίσεων συγχρονισμού-Push" + "message": "Μεταφορά ρυθμίσεων συγχρονισμού-Push" }, "quality": { - "message": "Ποιότητα" + "message": "Ποιότητα" + }, + "raised": { + "message": "Υψωμένος" + }, + "rateMe": { + "message": "Αξιολόγησε με" }, "rateUs": { - "message": "Αξιολόγησέ μας" + "message": "Αξιολόγησέ μας" }, "red": { - "message": "Κόκκινο" + "message": "Κόκκινο" }, "redDislikeButton": { - "message": "Μετατροπή «Δε μου αρέσει» σε κόκκινο" + "message": "Μετατροπή «Δε μου αρέσει» σε κόκκινο" }, "relatedVideos": { - "message": "Σχετικά videos" + "message": "Σχετικά videos" }, "remote": { - "message": "Παίξε στην TV" + "message": "Παίξε στην TV" }, "remove": { - "message": "Αφαίρεση" + "message": "Αφαίρεση" }, "removeBlackBars": { - "message": "Κατάργηση μαύρων μπαρών" + "message": "Κατάργηση μαύρων μπαρών" }, "removeIcons": { - "message": "Αφαίρεση εικονιδίων" + "message": "Αφαίρεση εικονιδίων" }, "removeName": { - "message": "Αφαίρεση ονόματος" + "message": "Αφαίρεση ονόματος" }, - "removeRelatedSearchResults": { - "message": "Αφαίρεση σχετικών αποτελεσμάτων αναζήτησης" + "removeNames": { + "message": "Αφαίρεση ονομάτων" }, - "RemoveSubtitlesForLyrics": { - "message": "Κατάργηση υποτίτλων για στίχους" + "removeRelatedSearchResults": { + "message": "Αφαίρεση σχετικών αποτελεσμάτων αναζήτησης" }, "removeShortsReelSearchResults": { - "message": "Αφαίρεση της λίστας Shorts από τα αποτελέσματα αναζήτησης" + "message": "Αφαίρεση της λίστας Shorts από τα αποτελέσματα αναζήτησης" + }, + "RemoveSubtitlesForLyrics": { + "message": "Κατάργηση υποτίτλων για στίχους" }, "repeat": { - "message": "Επανάληψη" + "message": "Επανάληψη" }, "report": { - "message": "Αναφορά" + "message": "Αναφορά" }, "reset": { - "message": "Επαναφορά" + "message": "Επαναφορά" }, "resetAllSettings": { - "message": "Επαναφορά όλων των ρυθμίσεων" + "message": "Επαναφορά όλων των ρυθμίσεων" }, "resetAllShortcuts": { - "message": "Επαναφορά όλων των συντομεύσεων" + "message": "Επαναφορά όλων των συντομεύσεων" }, "reverse": { - "message": "Ανάποδα" + "message": "Ανάποδα" }, "rotate": { - "message": "Περιστροφή" + "message": "Περιστροφή" }, "save": { - "message": "Αποθήκευση" + "message": "Αποθήκευση" }, "saveAs": { - "message": "Αποθήκευση ως" + "message": "Αποθήκευση ως" }, "schedule": { - "message": "Πρόγραμμα" + "message": "Πρόγραμμα", + "placeholders": {}, + "description": "" }, "screen": { - "message": "Οθόνη" + "message": "Οθόνη" }, "Screenshot": { - "message": "Στιγμιότυπο οθόνης" + "message": "Στιγμιότυπο οθόνης" }, "screenshot": { - "message": "Στιγμιότυπο οθόνης" + "message": "Στιγμιότυπο οθόνης" }, "sd": { - "message": "SD-Κανονική ευκρίνεια" + "message": "SD-Κανονική ευκρίνεια" }, "search": { - "message": "Αναζήτηση" + "message": "Αναζήτηση" }, "searchBarOnly": { - "message": "Πεδίο αναζήτησης μόνο" + "message": "Πεδίο αναζήτησης μόνο" }, "seekBackward10Seconds": { - "message": "Πίσω 10 δευτερόλεπτα" + "message": "Πίσω 10 δευτερόλεπτα" }, "seekForward10Seconds": { - "message": "Μπροστά 10 δευτερόλεπτα" + "message": "Μπροστά 10 δευτερόλεπτα" }, "seekNextChapter": { - "message": "Αναζήτηση επόμενου κεφαλαίου στο player" + "message": "Αναζήτηση επόμενου κεφαλαίου στο player" }, "seekPreviousChapter": { - "message": "Αναζήτηση προηγούμενου κεφαλαίου" + "message": "Αναζήτηση προηγούμενου κεφαλαίου" }, "settings": { - "message": "Ρυθμίσεις" + "message": "Ρυθμίσεις" }, "settingsSuccessfullyImported": { - "message": "Επιτυχής εισαγωγή ρυθμίσεων" + "message": "Επιτυχής εισαγωγή ρυθμίσεων" }, "share": { - "message": "Κοινοποίηση" + "message": "Κοινοποίηση" }, "shortcut_chapters": { - "message": "Συντόμευση κεφαλαίων του player" + "message": "Συντόμευση κεφαλαίων του player" }, "shortcuts": { - "message": "Συντομεύσεις" + "message": "Συντομεύσεις" + }, + "shortcut_screenshot": { + "message": "Στιγμιότυπο οθόνης" }, "shorts": { - "message": "Shorts" + "message": "Shorts" }, "showCardsOnMouseHover": { - "message": "Εμφάνιση καρτών όταν ο κέρσορας είναι από πάνω" + "message": "Εμφάνιση καρτών όταν ο κέρσορας είναι από πάνω" }, "showChannelVideosCount": { - "message": "Εμφάνιση συνολικών προβολών του καναλιού" + "message": "Εμφάνιση συνολικών προβολών του καναλιού" + }, + "showLess": { + "message": "Δείξε λιγότερα" + }, + "showMore": { + "message": "Δείξε περισσότερα" }, "showRemainingDuration": { - "message": "Εμφάνιση υπολειπόμενης διάρκειας" + "message": "Εμφάνιση υπολειπόμενης διάρκειας" }, "showVersion": { - "message": "Εμφάνιση έκδοσης" + "message": "Εμφάνιση έκδοσης" }, "shuffle": { - "message": "Τυχαία αναπαραγωγή" + "message": "Τυχαία αναπαραγωγή" }, "sidebar": { - "message": "Πλαϊνή στήλη" + "message": "Πλαϊνή στήλη" }, "Sidebar_simple_alternative": { - "message": "Απλή εναλλακτική πλαϊνή στήλη" + "message": "Απλή εναλλακτική πλαϊνή στήλη" }, - "softwareInformation": { - "message": "Πληροφορίες λογισμικού" + "message": "Πληροφορίες λογισμικού" }, "squaredUserImages": { - "message": "Τετράγωνες εικόνες χρήστη" + "message": "Τετράγωνες εικόνες χρήστη" }, "static": { - "message": "Στατικό" + "message": "Στατικό" }, "statsForNerds": { - "message": "Στατιστικά για Σπασίκλες" + "message": "Στατιστικά για Σπασίκλες" }, "step": { - "message": "Βήμα" + "message": "Βήμα" }, "stop": { - "message": "Διακοπή" + "message": "Διακοπή" }, "style": { - "message": "Στυλ" + "message": "Στυλ" }, "styles": { - "message": "Στυλ" + "message": "Στυλ" }, "subscribe": { - "message": "Συνδρομή" + "message": "Συνδρομή" }, "subscriptions": { - "message": "Συνδρομές" + "message": "Συνδρομές" }, "Subtitle_Capture_including_the_current_words": { - "message": "Καταγραφή υποτίτλων συμπεριλαμβανομένων των τρεχουσών λέξεων" + "message": "Καταγραφή υποτίτλων συμπεριλαμβανομένων των τρεχουσών λέξεων" }, "subtitles": { - "message": "Υπότιτλοι" + "message": "Υπότιτλοι" }, - "sunset": { - "message": "Ηλιοβασίλεμα" + "message": "Ηλιοβασίλεμα" }, "sunsetToSunrise": { - "message": "Από δύση έως ανατολή" + "message": "Από δύση έως ανατολή" }, "systemPeferenceDark": { - "message": "Προτίμηση συστήματος: Σκούρο" + "message": "Προτίμηση συστήματος: Σκούρο" }, "systemPeferenceLight": { - "message": "Προτίμηση συστήματος: Ανοιχτόχρωμο" + "message": "Προτίμηση συστήματος: Ανοιχτόχρωμο" }, "teal": { - "message": "Γαλαζοπράσινο" + "message": "Γαλαζοπράσινο" }, "textColor": { - "message": "Χρώμα κειμένου" + "message": "Χρώμα κειμένου" }, "themes": { - "message": "Θέματα" + "message": "Θέματα" }, "thisWillRemoveAllCookies": { - "message": "Αφαίρεση όλων των cookies." + "message": "Αφαίρεση όλων των cookies." }, "thisWillRemoveAllWatchedVideos": { - "message": "Διαγραφή ολόκληρου του Ιστορικού παρακολούθησης" + "message": "Διαγραφή ολόκληρου του Ιστορικού παρακολούθησης" }, "thisWillRemoveAllYouTubeCookies": { - "message": "Aφαίρεση των Youtube cookies." + "message": "Aφαίρεση των Youtube cookies." }, "thisWillResetAllSettings": { - "message": "Επαναφορά Ρυθμίσεων" + "message": "Επαναφορά Ρυθμίσεων" }, "thisWillResetAllShortcuts": { - "message": "Eπαναφορά όλων των συντομεύσεων." + "message": "Eπαναφορά όλων των συντομεύσεων." }, "thumbnails": { - "message": "Εικονίδια των Βιντεο-Μικρογραφίες" + "message": "Εικονίδια των Βιντεο-Μικρογραφίες" }, "thumbnailsQuality": { - "message": "Ποιότητα εικονιδίων" + "message": "Ποιότητα εικονιδίων" }, "timeFrom": { - "message": "Χρόνος από" + "message": "Χρόνος από" }, "timeTo": { - "message": "Χρόνος έως" + "message": "Χρόνος έως" }, "Titles": { - "message": "Τίτλοι" + "message": "Τίτλοι" }, "todayAt": { - "message": "Σήμερα στις" + "message": "Σήμερα στις" }, "toggleAutoplay": { - "message": "Εναλλαγή αυτόματης αναπαραγωγής" + "message": "Εναλλαγή αυτόματης αναπαραγωγής" }, "toggleCards": { - "message": "Εναλλαγή καρτών" + "message": "Εναλλαγή καρτών" }, "toggleControls": { - "message": "Eναλλαγή των controls" + "message": "Eναλλαγή των controls" + }, + "topChat": { + "message": "Top chat" }, "To_the_side_No_page_margin": { - "message": "Προς τα πλάγια χωρίς περιθώρια σελίδας" + "message": "Προς τα πλάγια χωρίς περιθώρια σελίδας" }, "trackWatchedVideos": { - "message": "Καταγραφή πληροφοριών Ιστορικού παρακολούθησης" + "message": "Καταγραφή πληροφοριών Ιστορικού παρακολούθησης" }, "trailerAutoplay": { - "message": "Αυτόματη αναπαραγωγή τρέιλερ" + "message": "Αυτόματη αναπαραγωγή τρέιλερ" }, "transcript": { - "message": "Αποσπάσματα" + "message": "Αποσπάσματα" }, "Transcript": { - "message": "Αποσπάσματα" + "message": "Αποσπάσματα" }, "translations": { - "message": "Μεταφράσεις" + "message": "Μεταφράσεις" }, "transparentBackground": { - "message": "Διαφανές φόντο" + "message": "Διαφανές φόντο" }, "TransparentBackground": { - "message": "Διαφανές φόντο" + "message": "Διαφανές φόντο" }, "transparentColor": { - "message": "Διαφανές χρώμα" + "message": "Διαφανές χρώμα" }, "trending": { - "message": "Τάσεις" + "message": "Τάσεις" }, "tryToReloadThePage": { - "message": "Προσπάθεια επαναφόρτωσης σελίδας" + "message": "Προσπάθεια επαναφόρτωσης σελίδας" }, "type": { - "message": "Τύπος" + "message": "Τύπος" }, "upNextAutoplay": { - "message": "Επόμενο στο autoplay" + "message": "Επόμενο στο autoplay" }, "use24HourFormat": { - "message": "Χρήση κανονικής 24ώρης μορφής ώρας" + "message": "Χρήση κανονικής 24ώρης μορφής ώρας" }, "version": { - "message": "Έκδοση" + "message": "Έκδοση" }, "video": { - "message": "Βίντεο" + "message": "Βίντεο" }, "videoDescriptionWillBeExpandedToGetNameOfCategory": { - "message": "Η περιγραφή του βίντεο θα επεκταθεί ωστε να συμπεριληφθεί το όνομα της κατηγορίας." + "message": "Η περιγραφή του βίντεο θα επεκταθεί ωστε να συμπεριληφθεί το όνομα της κατηγορίας." }, "videoFormats": { - "message": "Μορφές βίντεο" + "message": "Μορφές βίντεο" }, "videos": { - "message": "Βίντεο" + "message": "Βίντεο" }, "viewMode": { - "message": "Λειτουργία προβολής" + "message": "Λειτουργία προβολής" }, "volume": { - "message": "Ένταση" + "message": "Ένταση" }, "watchedVideos": { - "message": "Ιστορικό παρακολούθησης" + "message": "Ιστορικό παρακολούθησης" }, "watchLater": { - "message": "Προβολή αργότερα" + "message": "Προβολή αργότερα" }, "watchTime": { - "message": "Χρόνος προβολής" + "message": "Χρόνος προβολής" }, "whenPaused": { - "message": "Κατά την παύση" + "message": "Κατά την παύση" }, "whenTabIsChanged": { - "message": "Κατά την αλλαγή καρτέλας" + "message": "Κατά την αλλαγή καρτέλας" }, "white": { - "message": "Λευκό" + "message": "Λευκό" }, "windowColor": { - "message": "Χρώμα παραθύρου" + "message": "Χρώμα παραθύρου" }, "windowOpacity": { - "message": "Διαφάνεια παραθύρου" + "message": "Διαφάνεια παραθύρου" }, "with_scrollbars": { - "message": "Με scrollbar" + "message": "Με scrollbar" }, "yellow": { - "message": "Κίτρινο" + "message": "Κίτρινο" }, "youTubeButtons": { - "message": "YouTube-Κουμπιά" + "message": "YouTube-Κουμπιά" }, "youtubeHeaderLeft": { - "message": "Κεφαλίδα YouTube (αριστερά)" + "message": "Κεφαλίδα YouTube (αριστερά)" }, "youtubeHeaderRight": { - "message": "Κεφαλίδα YouTube (δεξιά)" + "message": "Κεφαλίδα YouTube (δεξιά)" }, "youtubeHomePage": { - "message": "Αρχική σελίδα YouTube" + "message": "Αρχική σελίδα YouTube" }, "youtubeLanguage": { - "message": "Γλώσσα YouTube" + "message": "Γλώσσα YouTube" }, "youtubeLimitsVideoQualityTo1080pForH264Codec": { - "message": "Το YouTube περιορίζει την ποιότητα σε 1080p για το h.264 codec" + "message": "Το YouTube περιορίζει την ποιότητα σε 1080p για το h.264 codec" + }, + "youtubesDark": { + "message": "YouTube-σκοτεινό" }, "Youtube_Search": { - "message": "Youtube-Αναζήτηση" + "message": "Youtube-Αναζήτηση" } } \ No newline at end of file From 8f8ab69a288b3fc6c0bee55b97f49e36737cffd1 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 23 Apr 2024 11:55:04 +0200 Subject: [PATCH 36/94] Update search.js keydown is redundant, input handles same case --- menu/skeleton-parts/search.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index 1730a5a95..7788cd265 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -26,21 +26,6 @@ extension.skeleton.header.sectionEnd.search.on.click = { this.remove(); } }, - keydown: function (event) { - var self = this; - - setTimeout(function () { - if (self.storage.value.length === 0 && event.key === 'Backspace') { - var search_results = document.querySelector('.search-results'); - - if (search_results) { - search_results.close(); - } - - self.baseProvider.classList.remove('search-mode'); - } - }); - }, input: function (event) { var self = this, value = this.value.trim(); @@ -205,8 +190,3 @@ extension.skeleton.header.sectionEnd.search.on.click = { } } }; - - - - - From 7919c69c4cbd58fceffa2db9c680ed3a481d132e Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 23 Apr 2024 12:32:59 +0200 Subject: [PATCH 37/94] Update search.js clean variable mess --- menu/skeleton-parts/search.js | 44 ++++++++++++++++------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index 7788cd265..9c6615c76 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -17,7 +17,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { }, blur: function () { if (this.value.length === 0) { - var search_results = document.querySelector('.search-results'); + let search_results = document.querySelector('.search-results'); if (search_results) { search_results.close(); @@ -27,40 +27,36 @@ extension.skeleton.header.sectionEnd.search.on.click = { } }, input: function (event) { - var self = this, + let self = this, value = this.value.trim(); if (value.length > 0) { satus.search(value, extension.skeleton, function (results) { - var search_results = document.querySelector('.search-results'), + let search_results = document.querySelector('.search-results'), skeleton = { component: 'modal', class: 'search-results' }; - for (var key in results) { - var result = results[key], - parent = result; + for (let key in results) { + let result = results[key], + parent = result, + category, + subcategory, + text; + + while (parent.parentObject && !parent.parentObject.category) { - while ( - parent.parentObject && - !parent.parentObject.category - ) { parent = parent.parentObject; } - var category = ''; - if (parent.parentObject && parent.parentObject.label && parent.parentObject.label.text) { category = parent.parentObject.label.text; } parent = result; - while ( - parent.parentObject && - parent.parentObject.component !== 'button' - ) { + while (parent.parentObject && parent.parentObject.component !== 'button') { parent = parent.parentObject; } @@ -68,15 +64,15 @@ extension.skeleton.header.sectionEnd.search.on.click = { if (parent) { if (parent.label) { - var subcategory = parent.label.text; + subcategory = parent.label.text; } else { - var subcategory = parent.text; + subcategory = parent.text; } if (category === subcategory) { - var text = satus.locale.get(category); + text = satus.locale.get(category); } else { - var text = satus.locale.get(category) + ' > ' + satus.locale.get(subcategory); + text = satus.locale.get(category) + ' > ' + satus.locale.get(subcategory); } skeleton[category + subcategory + '_label'] = { @@ -119,7 +115,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { } } else { if (search_results) { - var surface = document.querySelector('.search-results .satus-modal__surface'); + let surface = document.querySelector('.search-results .satus-modal__surface'); satus.empty(surface); @@ -130,7 +126,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { satus.render(skeleton, self.baseProvider); document.querySelector('.search-results .satus-modal__scrim').addEventListener('click', function () { - var text_field = this.parentElement.baseProvider.skeleton.header.sectionEnd.textField.rendered, + let text_field = this.parentElement.baseProvider.skeleton.header.sectionEnd.textField.rendered, search_results = document.querySelector('.search-results'); if (search_results) { @@ -146,7 +142,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { } }, true); } else { - var search_results = document.querySelector('.search-results'); + let search_results = document.querySelector('.search-results'); if (search_results) { search_results.close(); @@ -162,7 +158,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { variant: 'icon', on: { click: function () { - var search_results = document.querySelector('.search-results'); + let search_results = document.querySelector('.search-results'); if (search_results) { search_results.close(); From fe5fc40a950e4a69949a31191561503124591523 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 23 Apr 2024 16:36:24 +0200 Subject: [PATCH 38/94] Update search.js text_field was always broken funnily enough self is somehow still set while in this handler and points to same element as text_field --- menu/skeleton-parts/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index 9c6615c76..4aa126160 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -126,7 +126,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { satus.render(skeleton, self.baseProvider); document.querySelector('.search-results .satus-modal__scrim').addEventListener('click', function () { - let text_field = this.parentElement.baseProvider.skeleton.header.sectionEnd.textField.rendered, + let text_field = this.parentElement.baseProvider.skeleton.header.sectionEnd.search.on.click.rendered, search_results = document.querySelector('.search-results'); if (search_results) { From 650529807ed8c03fa4dc46337854d85de5687eb8 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 02:28:19 +0200 Subject: [PATCH 39/94] Update satus.js removing redundant addEventListener All the listeners are already setup by satus.render. code here was doubling them down resulting in Search being performed twice every time. --- menu/satus.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 3e128c808..90689118b 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1449,14 +1449,6 @@ satus.components.textField = function(component, skeleton) { component.pre.update(); component.cursor.update(); }); - - if (skeleton.on) { - for (var type in skeleton.on) { - input.addEventListener(type, function(event) { - this.parentNode.parentNode.dispatchEvent(new Event(event.type)); - }); - } - } }; /*-------------------------------------------------------------- >>> CHART From b889499116f978fcb3d6baadfafceabea935837a Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 02:34:59 +0200 Subject: [PATCH 40/94] Update satus.js respect storage: false on text-field elements Seatch text-field (Input) is of type component.skeleton.storage --- menu/satus.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 90689118b..78b159c3f 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1310,6 +1310,10 @@ satus.components.textField = function(component, skeleton) { component.syntax.set(skeleton.syntax); } + if (component.skeleton.storage) { + component.value = component.storage.value; + } + selection.setAttribute('disabled', ''); line_numbers.update = function() { @@ -1418,7 +1422,9 @@ satus.components.textField = function(component, skeleton) { input.addEventListener('input', function() { var component = this.parentNode.parentNode; - component.storage.value = this.value; + if (component.skeleton.storage) { + component.storage.value = this.value; + } component.lineNumbers.update(); component.pre.update(); @@ -1442,8 +1448,6 @@ satus.components.textField = function(component, skeleton) { this.cursor.update(); }); - component.value = component.storage.value || ''; - component.addEventListener('render', function() { component.lineNumbers.update(); component.pre.update(); From b3fbb0338eb34a06f927e9a5e6093b378fdcbcb8 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 02:43:12 +0200 Subject: [PATCH 41/94] Update satus.js propagate manual change 'text-field' value trigger 'change' event same way as in element.storage.set https://github.com/code-charity/youtube/blob/9c4e5f66e44bbe14cef4d59ce6f5cb1ae5e9d4fc/menu/satus.js#L785 --- menu/satus.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/menu/satus.js b/menu/satus.js index 78b159c3f..226518eda 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1303,6 +1303,8 @@ satus.components.textField = function(component, skeleton) { }, set: function(value) { this.input.value = value; + + this.dispatchEvent(new CustomEvent('change')); } }); From 0a7acbe3c3bad677cf31843d59291cfc6798114d Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Wed, 24 Apr 2024 05:42:32 +0200 Subject: [PATCH 42/94] Update README.md --- .github/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/README.md b/.github/README.md index 66025fda0..5d29ca86b 100644 --- a/.github/README.md +++ b/.github/README.md @@ -12,6 +12,7 @@ Donate · [Test🧪](https://github.com/code-for-charity/ImprovedTube-for-YouTube/archive/refs/heads/master.zip "Latest.zip") /ImprovedTube/ a powerful but lightweight extension,
to enrich your video experience & enable your content selection. +

Please join us! Also, lets re-define [`browser extension`](https://en.wikipedia.org/wiki/Browser_extension)! Why are they often unfunded & neglected?
Top ~ 60recommended by firefox g 'Might
be the only YouTube Extension you'll ever need'
'enhances YouTube in meaningful ways'
'Strong Add-on, full control. Yet clear & easy'

Thanks ♡ to our contributors, Alan Tan, Raszpl From 0678de8126d870548f2242eafd0d030cb0e9bf54 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 08:37:37 +0200 Subject: [PATCH 43/94] Update satus.js more graceful handling of clicking outside of modal dialog no more double .close() --- menu/satus.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 226518eda..17febdf1a 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1119,11 +1119,23 @@ satus.components.modal = function(component, skeleton) { }; component.scrim.addEventListener('click', function() { - // this is someone clicking outside of modal dialog, try cancel() first if default modal.confirm - if (skeleton.cancel && satus.isFunction(skeleton.cancel)) { - skeleton.cancel(); + // this is someone clicking outside of modal dialog + if (skeleton.variant == 'confirm') { + if (skeleton.buttons?.cancel) { + // modal.confirm.buttons variant, we click cancel, those have own closing mechanism + if (skeleton.buttons.cancel.rendered?.click && satus.isFunction(skeleton.buttons.cancel.rendered.click)) { + skeleton.buttons.cancel.rendered.click(); + } + } else { + // modal.confirm simplified variant, try optional cancel() then close() + if (skeleton.cancel && satus.isFunction(skeleton.cancel)) { + skeleton.cancel(); + } + this.parentNode.close(); + } + } else if (skeleton.variant == 'vertical-menu') { + this.parentNode.close(); } - this.parentNode.close(); }); if (satus.isset(skeleton.content)) { From 3b510d3bf938755b92ec7a8087e99544d66ea079 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 09:16:05 +0200 Subject: [PATCH 44/94] Update search.js phantom style set we never set style on text-field to begin with, no reason to try and remove it either --- menu/skeleton-parts/search.js | 1 - 1 file changed, 1 deletion(-) diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index 4aa126160..dde017ecd 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -134,7 +134,6 @@ extension.skeleton.header.sectionEnd.search.on.click = { } text_field.value = ''; - text_field.style.display = ''; self.removeAttribute('results'); }); From 2e8ef8b1325b9eb3463f5c2fbe5df445e0d7b864 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 11:29:54 +0200 Subject: [PATCH 45/94] Update satus.js stop adding storage component to storage: false elements --- menu/satus.js | 79 ++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 17febdf1a..595d97b65 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -742,52 +742,53 @@ satus.render = function(skeleton, container, property, childrenOnly, prepend, sk this.properties(element, skeleton.properties); this.on(element, skeleton.on); - element.storage = (function() { - var parent = element, - key = skeleton.storage || property || false, - value; - - if (satus.isFunction(key)) { - key = key(); - } - - if (skeleton.storage !== false) { - if (key) { - value = satus.storage.get(key); - } - - if (skeleton.hasOwnProperty('value') && value === undefined) { - value = skeleton.value; + // dont add storage component to storage: false elements + if (skeleton.storage != false) { + element.storage = (function() { + var parent = element, + key = skeleton.storage || property || false, + value; + + if (satus.isFunction(key)) { + key = key(); } - } - - return Object.defineProperties({}, { - key: { - get: function() { - return key; - }, - set: function(string) { - key = string; + + if (skeleton.storage !== false) { + if (key) { + value = satus.storage.get(key); } - }, - value: { - get: function() { - return value; + + if (skeleton.hasOwnProperty('value') && value === undefined) { + value = skeleton.value; + } + } + + return Object.defineProperties({}, { + key: { + get: function() { + return key; + }, + set: function(string) { + key = string; + } }, - set: function(val) { - value = val; - - if (satus.storage.get(key) != val) { - if (skeleton.storage !== false) { + value: { + get: function() { + return value; + }, + set: function(val) { + value = val; + + if (satus.storage.get(key) != val) { satus.storage.set(key, val); + + parent.dispatchEvent(new CustomEvent('change')); } - - parent.dispatchEvent(new CustomEvent('change')); } } - } - }); - }()); + }); + }()); + } if (this.components[camelizedTagName]) { this.components[camelizedTagName](element, skeleton); From e61348e9d1888a0ff29764e67a726cb60751b494 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 11:35:50 +0200 Subject: [PATCH 46/94] Update satus.js make ok() cancel() optional for modal.confirm simplified variant --- menu/satus.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 595d97b65..b9ecffd12 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1182,9 +1182,10 @@ satus.components.modal.confirm = function(component, skeleton) { }, on: { click: function() { - // no listeners for this Event currently exist in the codebase - this.modalProvider.dispatchEvent(new CustomEvent('cancel')); - this.modalProvider.skeleton.cancel(); + // cancel() is optional in modal.confirm simplified variant + if (this.modalProvider.skeleton.cancel && satus.isFunction(this.modalProvider.skeleton.cancel)) { + this.modalProvider.skeleton.cancel(); + } this.modalProvider.close(); } } @@ -1197,9 +1198,10 @@ satus.components.modal.confirm = function(component, skeleton) { }, on: { click: function() { - // no listeners for this Event currently exist in the codebase - this.modalProvider.dispatchEvent(new CustomEvent('confirm')); - this.modalProvider.skeleton.ok(); + // ok() is optional in modal.confirm simplified variant + if (this.modalProvider.skeleton.ok && satus.isFunction(this.modalProvider.skeleton.ok)) { + this.modalProvider.skeleton.ok(); + } this.modalProvider.close(); } } From e5f25ee0b98532e6a96b3d242312614b8b78e709 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 11:40:33 +0200 Subject: [PATCH 47/94] Update search.js remember last search query and search_results scroll position, restore on search reopen --- menu/skeleton-parts/search.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index dde017ecd..132537ea3 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -14,6 +14,10 @@ extension.skeleton.header.sectionEnd.search.on.click = { on: { render: function () { this.focus(); + if (extension.search) { + this.value = extension.search; + this.dispatchEvent(new CustomEvent('input')); + } }, blur: function () { if (this.value.length === 0) { @@ -30,6 +34,8 @@ extension.skeleton.header.sectionEnd.search.on.click = { let self = this, value = this.value.trim(); + extension.search = value; + if (value.length > 0) { satus.search(value, extension.skeleton, function (results) { let search_results = document.querySelector('.search-results'), @@ -123,19 +129,23 @@ extension.skeleton.header.sectionEnd.search.on.click = { } else { self.setAttribute('results', ''); - satus.render(skeleton, self.baseProvider); + search_results = satus.render(skeleton, self.baseProvider); + + if (extension.searchPosition) { + search_results.childNodes[1].scrollTop = extension.searchPosition; + } document.querySelector('.search-results .satus-modal__scrim').addEventListener('click', function () { + // this is someone clicking outside of Search results window let text_field = this.parentElement.baseProvider.skeleton.header.sectionEnd.search.on.click.rendered, search_results = document.querySelector('.search-results'); if (search_results) { + extension.searchPosition = search_results.childNodes[1].scrollTop; search_results.close(); } - text_field.value = ''; - - self.removeAttribute('results'); + self.skeleton.close.rendered.click() }); } } @@ -160,6 +170,7 @@ extension.skeleton.header.sectionEnd.search.on.click = { let search_results = document.querySelector('.search-results'); if (search_results) { + extension.searchPosition = search_results.childNodes[1].scrollTop; search_results.close(); } From d5ca18af793ecfaf09e3498e457a059cfd47bbe8 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 11:41:46 +0200 Subject: [PATCH 48/94] Update skeleton.js search restore variables --- menu/skeleton.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/menu/skeleton.js b/menu/skeleton.js index b6136141e..723369210 100644 --- a/menu/skeleton.js +++ b/menu/skeleton.js @@ -11,7 +11,9 @@ --------------------------------------------------------------*/ extension.skeleton = { - component: 'base' + component: 'base', + search: false, + searchPosition: 0 }; @@ -245,4 +247,4 @@ extension.skeleton.main = { } }, "frame": { component: 'iframe', class: 'frame', attr: { 'src': 'https://improvedtube.com/wishes', 'style': 'border: none; bottom: 0px; overflow: hidden; width:326px; position:absolute; height:212px; left:-6px !important' } } } -}; \ No newline at end of file +}; From c29e70649df78950fec708a904b5b1e5b27c7961 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 12:09:12 +0200 Subject: [PATCH 49/94] Update satus.js listener on wrong element --- menu/satus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/satus.js b/menu/satus.js index b9ecffd12..2798339d5 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1430,7 +1430,7 @@ satus.components.textField = function(component, skeleton) { component.hiddenValue.textContent = ''; }; - document.addEventListener('selectionchange', function(event) { + input.addEventListener('selectionchange', function(event) { component.lineNumbers.update(); component.pre.update(); component.cursor.update(); From 8938d72f154db59a8765774a12b9fdc93783268c Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 24 Apr 2024 12:20:53 +0200 Subject: [PATCH 50/94] Update satus.js parentObject is not an event type, skip it when creating listeners --- menu/satus.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/menu/satus.js b/menu/satus.js index 2798339d5..ba4d7282d 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -562,6 +562,10 @@ satus.toIndex = function(index, child, parent) { satus.on = function(element, listeners) { if (listeners) { for (var type in listeners) { + if (type == 'parentObject') { + continue; + } + var listener = listeners[type]; if (type === 'selectionchange') { From 0df99de35dccf354894618cf206741375b3c4ef0 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 25 Apr 2024 11:01:49 +0200 Subject: [PATCH 51/94] Update satus.js clean selectionchange listener after use reverting https://github.com/code-charity/youtube/pull/2201/commits/c29e70649df78950fec708a904b5b1e5b27c7961 selectionchange works only globally on document doh! This makes it remove listener when its no longer used, no more multiplying global listeners for non existent elements being created every time we render 'text-field'. --- menu/satus.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index ba4d7282d..5f22b26ad 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1434,11 +1434,18 @@ satus.components.textField = function(component, skeleton) { component.hiddenValue.textContent = ''; }; - input.addEventListener('selectionchange', function(event) { + // global listener, make sure we remove when element no longer exists + function selectionchange(event) { + if (!document.body.contains(component)) { + document.removeEventListener('selectionchange', selectionchange); + return; + } component.lineNumbers.update(); component.pre.update(); component.cursor.update(); - }); + }; + + document.addEventListener('selectionchange', selectionchange); input.addEventListener('input', function() { var component = this.parentNode.parentNode; From 220d429107a9fa3f11633a4529d83dce7f2d0e86 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Thu, 25 Apr 2024 13:56:15 +0200 Subject: [PATCH 52/94] Update satus.js component: 'slider' is storage: false, respect that --- menu/satus.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 5f22b26ad..675424e25 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1895,7 +1895,7 @@ satus.components.colorPicker = function(component, skeleton) { var modal = this.skeleton.parentSkeleton.parentSkeleton, hsl = modal.value; - hsl[0] = this.storage.value; + hsl[0] = this.value; this.previousSibling.style.backgroundColor = 'hsl(' + hsl[0] + 'deg,' + hsl[1] + '%, ' + hsl[2] + '%)'; this.parentNode.previousSibling.style.backgroundColor = 'hsl(' + hsl[0] + 'deg, 100%, 50%)'; @@ -2010,13 +2010,12 @@ satus.components.slider = function(component, skeleton) { input.min = skeleton.min || 0; input.max = skeleton.max || 1; input.step = skeleton.step || 1; - input.value = component.storage.value || skeleton.value || 0; + input.value = component.storage?.value || skeleton.value || 0; text_input.addEventListener('blur', function() { var component = this.parentNode.parentNode; component.input.value = Number(this.value.replace(/[^0-9.]/g, '')); - component.storage.value = Number(component.input.value); component.update(); }); @@ -2026,7 +2025,6 @@ satus.components.slider = function(component, skeleton) { var component = this.parentNode.parentNode; component.input.value = Number(this.value.replace(/[^0-9.]/g, '')); - component.storage.value = Number(component.input.value); component.update(); } @@ -2035,7 +2033,7 @@ satus.components.slider = function(component, skeleton) { input.addEventListener('input', function() { var component = this.parentNode.parentNode; - component.storage.value = Number(this.value); + component.value = Number(this.value); component.update(); }); From 169f5ac996a073d74c7780f26be896332af1d226 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 02:03:22 +0200 Subject: [PATCH 53/94] Update satus.js colorPicker is a modal popup, dont put it on layers (our history queue) --- menu/satus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/satus.js b/menu/satus.js index 675424e25..bfb17d996 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1947,7 +1947,7 @@ satus.components.colorPicker = function(component, skeleton) { } } } - }, this.baseProvider.layers[0]); + }, this.baseProvider); }); }; /*-------------------------------------------------------------- From cb32368b9e23a423ee98c6b2ba19b5368a7507cb Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 02:23:25 +0200 Subject: [PATCH 54/94] Update satus.js new modal variant: 'shortcut' --- menu/satus.js | 1 + 1 file changed, 1 insertion(+) diff --git a/menu/satus.js b/menu/satus.js index bfb17d996..93bcd1575 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -2267,6 +2267,7 @@ satus.components.shortcut = function(component, skeleton) { component.addEventListener('click', function() { satus.render({ component: 'modal', + variant: 'shortcut', properties: { parent: this }, From 80ee19a7a3c96136a08154e93609bcf5f62585e6 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 02:47:31 +0200 Subject: [PATCH 55/94] Update satus.js better handling of clicking outside modal --- menu/satus.js | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 93bcd1575..cbffbab27 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1125,21 +1125,34 @@ satus.components.modal = function(component, skeleton) { component.scrim.addEventListener('click', function() { // this is someone clicking outside of modal dialog - if (skeleton.variant == 'confirm') { - if (skeleton.buttons?.cancel) { - // modal.confirm.buttons variant, we click cancel, those have own closing mechanism - if (skeleton.buttons.cancel.rendered?.click && satus.isFunction(skeleton.buttons.cancel.rendered.click)) { - skeleton.buttons.cancel.rendered.click(); - } - } else { - // modal.confirm simplified variant, try optional cancel() then close() - if (skeleton.cancel && satus.isFunction(skeleton.cancel)) { - skeleton.cancel(); + switch (skeleton.variant) { + case 'confirm': + if (skeleton.buttons?.cancel) { + // modal.confirm.buttons variant have own closing mechanism, lets try to click cancel button + if (skeleton.buttons.cancel1?.rendered?.click && satus.isFunction(skeleton.buttons.cancel.rendered.click)) { + skeleton.buttons.cancel.rendered.click(); + } else { + // cant find cancel button, just force close it + this.parentNode.close(); + } + } else { + // modal.confirm simplified variant, try optional cancel() then close() + if (skeleton.cancel && satus.isFunction(skeleton.cancel)) { + skeleton.cancel(); + } + this.parentNode.close(); } + break; + + case 'vertical-menu': this.parentNode.close(); - } - } else if (skeleton.variant == 'vertical-menu') { - this.parentNode.close(); + break; + + case 'shortcut': + case 'color-picker': + // click cancel button + skeleton.actions.cancel.rendered.click(); + break; } }); From e1c180a085534f3749bdc2d2b0c4522eacc4e548 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 05:09:02 +0200 Subject: [PATCH 56/94] Update themes.js group property is only for component: 'radio' --- menu/skeleton-parts/themes.js | 1 - 1 file changed, 1 deletion(-) diff --git a/menu/skeleton-parts/themes.js b/menu/skeleton-parts/themes.js index 33a5f6179..7fdd90ee0 100644 --- a/menu/skeleton-parts/themes.js +++ b/menu/skeleton-parts/themes.js @@ -58,7 +58,6 @@ extension.skeleton.main.layers.section.themes.on.click.section = { section: { component: 'section', variant: 'card', - group: 'theme', theme_primary_color: { component: 'color-picker', text: 'primaryColor', From 3e2dddf73ef32423fab1945fc7a2eb456f4bdb89 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 15:59:09 +0200 Subject: [PATCH 57/94] Update satus.js extend .on listener to redirecting to elements like we now allow calling functions like https://github.com/code-charity/youtube/blob/98338c8305169195487b8cdc3e23749a6c781e85/menu/skeleton.js#L36 but instead of calling a function we can point to an element path click: 'main.layers.section.appearance.on.click.player.on.click.player_hide_controls_options.on.click' lets us define elements that redirect to other elements --- menu/satus.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index 3e128c808..6325af111 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -592,19 +592,27 @@ satus.on = function(element, listeners) { }); } else if (satus.isString(listener)) { element.addEventListener(type, function() { - var match = this.skeleton.on[event.type].match(/(["'`].+["'`]|[^.()]+)/g), + let match = this.skeleton.on[event.type].match(/(["'`].+["'`]|[^.()]+)/g), target = this.baseProvider; - for (var i = 0, l = match.length; i < l; i++) { - var key = match[i]; + for (let i = 0, l = match.length; i < l; i++) { + let key = match[i]; - if (target.skeleton[key]) { + if (target.skeleton && target.skeleton[key]) { target = target.skeleton[key]; } else { if (typeof target[key] === 'function') { target[key](); } else { target = target[key]; + // render last element if its not a function, lets us use redirects + if (i == match.length-1 && (typeof target != 'function')) { + let layers = this.layersProvider; + if (!layers && this.baseProvider.layers.length > 0) { + layers = this.baseProvider.layers[0]; + } + layers.open(target); + } } } From 3a2defa53be27d6c7f3b3ef75c6d3eb44401706d Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 16:01:59 +0200 Subject: [PATCH 58/94] Update player.js use .on redirect instead of doubling code --- menu/skeleton-parts/player.js | 50 +---------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/menu/skeleton-parts/player.js b/menu/skeleton-parts/player.js index b2bcf2fbe..208d913b9 100644 --- a/menu/skeleton-parts/player.js +++ b/menu/skeleton-parts/player.js @@ -1065,55 +1065,7 @@ extension.skeleton.main.layers.section.player.on.click = { component: "button", text: "hidePlayerControlsBarButtons", on: { - click: { - component: "section", - variant: "card", - - player_play_button: { - component: "switch", - text: "playPause" - }, - player_previous_button: { - component: "switch", - text: "previousVideo" - }, - player_next_button: { - component: "switch", - text: "nextVideo" - }, - player_volume_button: { - component: "switch", - text: "volume" - }, - player_autoplay_button: { - component: "switch", - text: "autoplay" - }, - player_settings_button: { - component: "switch", - text: "settings" - }, - player_subtitles_button: { - component: "switch", - text: "subtitles" - }, - player_miniplayer_button: { - component: "switch", - text: "nativeMiniPlayer" - }, - player_view_button: { - component: "switch", - text: "viewMode" - }, - player_screen_button: { - component: "switch", - text: "screen" - }, - player_remote_button: { - component: "switch", - text: "remote" - } - } + click: 'main.layers.section.appearance.on.click.player.on.click.player_hide_controls_options.on.click' } }, } From fdf3d809c4ebaeca37fde401e23e59c2efcaf220 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 16:33:07 +0200 Subject: [PATCH 59/94] Update satus.js include buttons in search this is it, the big one! :) --- menu/satus.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/menu/satus.js b/menu/satus.js index cbffbab27..91c4943b0 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -3167,7 +3167,7 @@ satus.user.device.connection = function() { --------------------------------------------------------------*/ satus.search = function(query, object, callback) { - var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker', 'label'], + var elements = ['switch', 'select', 'slider', 'shortcut', 'radio', 'color-picker', 'label', 'button'], threads = 0, results = {}, excluded = [ @@ -3186,12 +3186,18 @@ satus.search = function(query, object, callback) { function parse(items, parent) { threads++; - for (var key in items) { - if (excluded.indexOf(key) === -1) { + for (const key in items) { + if (!excluded.includes(key)) { var item = items[key]; - if (item.component && item.text && elements.indexOf(item.component) !== -1 - && (satus.locale.data[item.text] ? satus.locale.data[item.text] : item.text).toLowerCase().indexOf(query) !== -1) { + if (item.component && item.text + // list of elements we allow search on + && elements.includes(item.component) + // only pass buttons whose parents are variant: 'card' or special case 'appearance' (this one abuses variant tag for CSS) + && (item.component != 'button' || item.parentObject?.variant == "card" || item.parentObject?.variant == "appearance") + // try to match query against localized description, fallback on component name + && (satus.locale.data[item.text] ? satus.locale.data[item.text] : item.text).toLowerCase().includes(query)) { + // plop matching results in array - this means we cant have two elements with same name in results results[key] = Object.assign({}, item); } From 34136192f85741e082061e9334ed54cc72eba64d Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 17:01:45 +0200 Subject: [PATCH 60/94] Update appearance.js solves double use of same element name --- menu/skeleton-parts/appearance.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/menu/skeleton-parts/appearance.js b/menu/skeleton-parts/appearance.js index d0958163b..f1cc70b07 100644 --- a/menu/skeleton-parts/appearance.js +++ b/menu/skeleton-parts/appearance.js @@ -683,9 +683,10 @@ extension.skeleton.main.layers.section.appearance.on.click.comments = { component: "section", variant: "card", - comments: { + comments_show: { component: "select", text: "comments", + storage: 'comments', options: [{ text: "normal", From 65647f8730aa2331f91f8b67a31057dac529a799 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 18:00:46 +0200 Subject: [PATCH 61/94] Update search.js hide search results when clicking on result that is a 'button' inside search results second piece of the puzzle to make categories work in search results --- menu/skeleton-parts/search.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index 132537ea3..03ecd0d0c 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -131,14 +131,36 @@ extension.skeleton.header.sectionEnd.search.on.click = { search_results = satus.render(skeleton, self.baseProvider); + // we need global listener here + function hidesearch(event) { + // make sure to clean it after closing search results + if (!document.body.contains(search_results)) { + document.removeEventListener('click', hidesearch); + } + // hide search results when clicking on result that is a 'button' inside search results + if (search_results.contains(event.target) && event.target.className.includes('satus-button') + // dont close on modal popups + && !(event.target.skeleton?.on?.click?.component == "modal") + // shortcut are also modal popups + && !(event.target.skeleton?.component == "shortcut")) { + search_results.close(); + self.skeleton.close.rendered.click(); + } else if (event.target.closest('.satus-modal.satus-modal--vertical-menu') && event.target.closest('.satus-button')) { + // hide search results when clicking on vertical-menu button + search_results.close(); + self.skeleton.close.rendered.click(); + } + } + + document.addEventListener('click', hidesearch); + if (extension.searchPosition) { search_results.childNodes[1].scrollTop = extension.searchPosition; } document.querySelector('.search-results .satus-modal__scrim').addEventListener('click', function () { // this is someone clicking outside of Search results window - let text_field = this.parentElement.baseProvider.skeleton.header.sectionEnd.search.on.click.rendered, - search_results = document.querySelector('.search-results'); + let search_results = document.querySelector('.search-results'); if (search_results) { extension.searchPosition = search_results.childNodes[1].scrollTop; From 3b3c8dfe0f8f924183a7d10cc7dbab4597a9732e Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Fri, 26 Apr 2024 18:07:58 +0200 Subject: [PATCH 62/94] Update satus.js leftover from debugging --- menu/satus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/satus.js b/menu/satus.js index 91c4943b0..33e09b0e4 100644 --- a/menu/satus.js +++ b/menu/satus.js @@ -1129,7 +1129,7 @@ satus.components.modal = function(component, skeleton) { case 'confirm': if (skeleton.buttons?.cancel) { // modal.confirm.buttons variant have own closing mechanism, lets try to click cancel button - if (skeleton.buttons.cancel1?.rendered?.click && satus.isFunction(skeleton.buttons.cancel.rendered.click)) { + if (skeleton.buttons.cancel?.rendered?.click && satus.isFunction(skeleton.buttons.cancel.rendered.click)) { skeleton.buttons.cancel.rendered.click(); } else { // cant find cancel button, just force close it From c926fea56ef3989c30560f1b8d13cdb89f98e8af Mon Sep 17 00:00:00 2001 From: Alpaczyk Date: Fri, 26 Apr 2024 22:30:01 +0200 Subject: [PATCH 63/94] Languages --- _locales/ar/messages.json | 3 +++ _locales/bg/messages.json | 3 +++ _locales/ca/messages.json | 3 +++ _locales/cs/messages.json | 3 +++ _locales/da/messages.json | 3 +++ _locales/de/messages.json | 3 +++ _locales/en/messages.json | 3 +++ _locales/en_GB/messages.json | 3 +++ _locales/en_US/messages.json | 3 +++ _locales/es/messages.json | 3 +++ _locales/es_419/messages.json | 3 +++ _locales/fr/messages.json | 3 +++ _locales/it/messages.json | 3 +++ _locales/pl/messages.json | 3 +++ _locales/ru/messages.json | 3 +++ _locales/uk/messages.json | 3 +++ 16 files changed, 48 insertions(+) diff --git a/_locales/ar/messages.json b/_locales/ar/messages.json index 3f72da703..23dba5d39 100644 --- a/_locales/ar/messages.json +++ b/_locales/ar/messages.json @@ -578,6 +578,9 @@ "quality": { "message": "الجودة" }, + "qualityWithoutFocus": { + "message": "الجودة بدون تركيز" + }, "ram": { "message": "الذاكرة العشوائية" }, diff --git a/_locales/bg/messages.json b/_locales/bg/messages.json index e8df866eb..dfca02127 100644 --- a/_locales/bg/messages.json +++ b/_locales/bg/messages.json @@ -2,6 +2,9 @@ "hideHomePageShorts": { "message": "Премахни Shorts от началната страница" }, + "qualityWithoutFocus": { + "message": "Качество без фокус" + }, "removeShortsReelSearchResults": { "message": "Премахнете ролката Shorts от резултатите от търсенето" } diff --git a/_locales/ca/messages.json b/_locales/ca/messages.json index ecab9114b..6f9e563e4 100644 --- a/_locales/ca/messages.json +++ b/_locales/ca/messages.json @@ -2,6 +2,9 @@ "hideHomePageShorts": { "message": "Elimina els Shorts de la pàgina d'inici" }, + "qualityWithoutFocus": { + "message": "Quality without focus" + }, "removeShortsReelSearchResults": { "message": "Elimineu el carrossel de Shorts dels resultats de cerca" } diff --git a/_locales/cs/messages.json b/_locales/cs/messages.json index efce60706..f30c00592 100644 --- a/_locales/cs/messages.json +++ b/_locales/cs/messages.json @@ -2,6 +2,9 @@ "hideHomePageShorts": { "message": "Odebrat Shorts z úvodní stránky" }, + "qualityWithoutFocus": { + "message": "Quality without focus" + }, "removeShortsReelSearchResults": { "message": "Odstraňte karuselu Shorts z výsledků vyhledávání" } diff --git a/_locales/da/messages.json b/_locales/da/messages.json index 10d17c8db..4037ce15c 100644 --- a/_locales/da/messages.json +++ b/_locales/da/messages.json @@ -2,6 +2,9 @@ "hideHomePageShorts": { "message": "Fjern Shorts fra hjemmesiden" }, + "qualityWithoutFocus": { + "message": "Quality without focus" + }, "removeShortsReelSearchResults": { "message": "Fjern Shorts-rulle fra søgeresultaterne" } diff --git a/_locales/de/messages.json b/_locales/de/messages.json index d8999c9ec..805ea1944 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -566,6 +566,9 @@ "quality": { "message": "Qualität" }, + "qualityWithoutFocus": { + "message": "Qualität ohne Fokus" + }, "raised": { "message": "Erhöht" }, diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 3fff99299..06d55f059 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -968,6 +968,9 @@ "quality": { "message": "Quality" }, + "qualityWithoutFocus": { + "message": "Quality without focus" + }, "raised": { "message": "Raised" }, diff --git a/_locales/en_GB/messages.json b/_locales/en_GB/messages.json index 6215785c6..681d1a944 100644 --- a/_locales/en_GB/messages.json +++ b/_locales/en_GB/messages.json @@ -41,6 +41,9 @@ "primaryColor": { "message": "Primary colour" }, + "qualityWithoutFocus": { + "message": "Quality without focus" + }, "textColor": { "message": "Text colour" }, diff --git a/_locales/en_US/messages.json b/_locales/en_US/messages.json index 05d2997b1..a9070ba5b 100644 --- a/_locales/en_US/messages.json +++ b/_locales/en_US/messages.json @@ -4,5 +4,8 @@ }, "player_rotate_button": { "message": "player rotate button" + }, + "qualityWithoutFocus": { + "message": "Quality without focus" } } \ No newline at end of file diff --git a/_locales/es/messages.json b/_locales/es/messages.json index bae4a5fdf..92e868232 100644 --- a/_locales/es/messages.json +++ b/_locales/es/messages.json @@ -806,6 +806,9 @@ "quality": { "message": "Calidad" }, + "qualityWithoutFocus": { + "message": "Calidad sin enfoque" + }, "rateMe": { "message": "Califícame" }, diff --git a/_locales/es_419/messages.json b/_locales/es_419/messages.json index 356089ddf..b900b232b 100644 --- a/_locales/es_419/messages.json +++ b/_locales/es_419/messages.json @@ -668,6 +668,9 @@ "quality": { "message": "Calidad" }, + "qualityWithoutFocus": { + "message": "Calidad sin enfoque" + }, "rateMe": { "message": "Califícame" }, diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index e63f57874..ba05bb901 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -512,6 +512,9 @@ "quality": { "message": "Qualité" }, + "qualityWithoutFocus": { + "message": "Qualité sans concentration" + }, "rateUs": { "message": "Nous évaluer" }, diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 8786d3d9e..c9bd45458 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -680,6 +680,9 @@ "quality": { "message": "Qualità" }, + "qualityWithoutFocus": { + "message": "Kualitas Tanpa Fokus" + }, "raised": { "message": "Rialzato" }, diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json index 6bc9ca295..d3463615b 100644 --- a/_locales/pl/messages.json +++ b/_locales/pl/messages.json @@ -704,6 +704,9 @@ "quality": { "message": "Jakość" }, + "qualityWithoutFocus": { + "message": "Jakość bez ostrości" + }, "raised": { "message": "Podniesione" }, diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index 270f8cef4..cee7e2075 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -755,6 +755,9 @@ "quality": { "message": "Качество" }, + "qualityWithoutFocus": { + "message": "Качество при неактивном окне" + }, "raised": { "message": "Поднятый" }, diff --git a/_locales/uk/messages.json b/_locales/uk/messages.json index b11b68781..5dc8d5d6d 100644 --- a/_locales/uk/messages.json +++ b/_locales/uk/messages.json @@ -8,6 +8,9 @@ "hideHomePageShorts": { "message": "Видалити Shorts з головної сторінки" }, + "qualityWithoutFocus": { + "message": "Якість при неактивному вікні" + }, "removeShortsReelSearchResults": { "message": "Видаліть карусель Shorts з результатів пошуку" } From c2febb170d3a768c56d9f076a4336b1769bba18d Mon Sep 17 00:00:00 2001 From: Alpaczyk Date: Fri, 26 Apr 2024 23:23:13 +0200 Subject: [PATCH 64/94] functionality --- js&css/web-accessible/functions.js | 1 + .../web-accessible/www.youtube.com/player.js | 56 ++++++++++++++++ menu/skeleton-parts/player.js | 65 +++++++++++++++++++ 3 files changed, 122 insertions(+) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index e8e911871..372d58777 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -290,6 +290,7 @@ ImprovedTube.pageType = function () { ImprovedTube.pageOnFocus = function () { ImprovedTube.playerAutopauseWhenSwitchingTabs(); ImprovedTube.playerAutoPip(); + ImprovedTube.playerQualityWithoutFocus(); }; ImprovedTube.videoPageUpdate = function () { diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index bed321991..6ed11a2a2 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -533,6 +533,62 @@ ImprovedTube.playerQuality = function () { } }; /*------------------------------------------------------------------------------ +QUALITY WITHOUT FOCUS +------------------------------------------------------------------------------*/ +ImprovedTube.playerQualityWithoutFocus = function () { + function closest (num, arr) { + let curr = arr[0]; + let diff = Math.abs (num - curr); + for (let val = 0; val < arr.length; val++) { + let newdiff = Math.abs (num - arr[val]); + if (newdiff < diff) { + diff = newdiff; + curr = arr[val]; + } + } + return curr; + }; + var player = this.elements.player, + qualityWithoutFocus = this.storage.player_quality_without_focus; + quality = this.storage.player_quality; + if(qualityWithoutFocus && qualityWithoutFocus != 'disabled' && player){ + if(this.focus === false) { + var available_quality_levels = player.getAvailableQualityLevels(); + if (available_quality_levels.includes(qualityWithoutFocus) === false) { + let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; + let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; + let availableresolutions = available_quality_levels.reduce(function (array, elem) { + array.push(resolution[label.indexOf(elem)]); return array; + }, []); + + qualityWithoutFocus = closest (resolution[label.indexOf(qualityWithoutFocus)], availableresolutions); + qualityWithoutFocus = label[resolution.indexOf(qualityWithoutFocus)]; + } + + player.setPlaybackQualityRange(qualityWithoutFocus); + player.setPlaybackQuality(qualityWithoutFocus); + + } + if (this.focus === true){ + var available_quality_levels = player.getAvailableQualityLevels(); + if (available_quality_levels.includes(quality) === false) { + let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; + let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; + let availableresolutions = available_quality_levels.reduce(function (array, elem) { + array.push(resolution[label.indexOf(elem)]); return array; + }, []); + + quality = closest (resolution[label.indexOf(quality)], availableresolutions); + quality = label[resolution.indexOf(quality)]; + } + + player.setPlaybackQualityRange(quality); + player.setPlaybackQuality(quality); + } + } + +}; +/*------------------------------------------------------------------------------ FORCED VOLUME ------------------------------------------------------------------------------*/ ImprovedTube.playerVolume = function () { diff --git a/menu/skeleton-parts/player.js b/menu/skeleton-parts/player.js index 208d913b9..d82fc85bf 100644 --- a/menu/skeleton-parts/player.js +++ b/menu/skeleton-parts/player.js @@ -760,6 +760,70 @@ extension.skeleton.main.layers.section.player.on.click = { } } }, + player_quality_without_focus: { + component: 'select', + text: 'qualityWithoutFocus', + id: 'player_quality_without_focus', + options: [{ + text: 'disabled', + value: 'disabled' + }, { + text: '144p', + value: 'tiny' + }, { + text: '240p', + value: 'small' + }, { + text: '360p', + value: 'medium' + }, { + text: '480p', + value: 'large' + }, { + text: '720p', + value: 'hd720' + }, { + text: '1080p', + value: 'hd1080' + }, { + text: '1440p', + value: 'hd1440' + }, { + text: '2160p', + value: 'hd2160' + }, { + text: '2880p', + value: 'hd2880' + }, { + text: '4320p', + value: 'highres' + }], + on: { + render: function () { + if (satus.storage.get('player_h264')) { + if (this.childNodes[2].selectedIndex >6) { + this.childNodes[1].style = 'color: red!important; font-weight: bold;'; + this.childNodes[1].textContent = '1080p'; + } else { + this.childNodes[1].style = ''; + this.childNodes[1].textContent = this.childNodes[2].options[this.childNodes[2].selectedIndex].text; + } + for (let index =7; index <= 10; index++) { + this.childNodes[2].childNodes[index].style = 'color: red!important; font-weight: bold;'; + } + } else if (satus.storage.get('block_vp9') && satus.storage.get('block_h264')) { + this.childNodes[1].style = 'color: red!important; font-weight: bold;'; + this.childNodes[1].textContent = 'Video disabled'; + } else { + this.childNodes[1].style = ''; + this.childNodes[1].textContent = this.childNodes[2].options[this.childNodes[2].selectedIndex].text; + for (let index =7; index <= 10; index++) { + this.childNodes[2].childNodes[index].style = ''; + } + } + } + } + }, player_codecs: { component: 'button', text: 'codecs', @@ -895,6 +959,7 @@ extension.skeleton.main.layers.section.player.on.click = { document.getElementById('player_quality').dispatchEvent(new CustomEvent('render')); document.getElementById('player_codecs').dispatchEvent(new CustomEvent('render')); document.getElementById('optimize_codec_for_hardware_acceleration').dispatchEvent(new CustomEvent('render')); + document.getElementById('player_quality_without_focus').dispatchEvent(new CustomEvent('render')); } if (this.dataset.value === 'false') { let where = this; From 2a38835ff408fe28431684d09b43443cde12843b Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sat, 27 Apr 2024 09:22:16 +0200 Subject: [PATCH 65/94] Update README.md --- .github/README.md | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/README.md b/.github/README.md index 5d29ca86b..043311567 100644 --- a/.github/README.md +++ b/.github/README.md @@ -215,9 +215,9 @@ Please notify us if you have relavant (volunteer) work beyond this project! (or web store web store analytics

youtube recommmendation

Do you need to run a popular extension, site, app or repo?
We'd love to help meaningful projects@improvedtube.com -

- -🏝🏕 **To-Do / Maintenance:**

🏷️ Labels

(sorted/Filtered = Dynamic To-Do lists)
+
+
+🏝🏕 To-Do / Maintenance:

🏷️ Labels

(sorted/Filtered = Dynamic To-Do lists)
**0.** [ ] [**Bugs🐞**](https://github.com/code4charity/YouTube-Extension/issues?q=label%3Abug+sort%3Acomments-desc+is%3Aopen+-label%3A_+ "we aim to offer some bug-bounties. Please ask") (we try to offer some bug bounty. [Please ask](mailto:bugs@improvedtube.com?subject=TODO_BOUNTY_LINK "especially if you are at a cheap/poor place ❤️") .) @@ -229,11 +229,24 @@ Please notify us if you have relavant (volunteer) work beyond this project! (or
**0.1. [ ]** Tidy: [(Rest/Unsorted 'issues')](https://github.com/code4charity/YouTube-Extension/issues?q=is%3Aissue+is%3Aopen+-label%3Abug+-label%3A%22Feature+Request%22+-label%3A%F0%9F%A7%A9Plan%20ready+-label%3A_+-label%3A%22not+Goo.+Chrome%22+sort%3Acreated-desc++-label%3A"Niche%2Frare+usecase%3F%2Ffun%3F"++-label%3Aunclear "Our github issues, which are not yet labled yet to appear in one of the ToDo-categories above") > Further reading: [***"Contributing without programming"***](https://github.com/ImprovedTube/YouTube-Extension/discussions/753) & [*"Our CSS, JavaScript, json"*](https://github.com/ImprovedTube/ImprovedTube/pull/371#issuecomment-669725163) ( ***outdated**)* (*Newcomers are [we](https://github.com/ImprovedTube/ImprovedTube/issues/387#issuecomment-664980078)lcome tho! We review all edits & love to collaborate*) -

+

+
Features 🧰⋮⚙️🎛️☕🎧🎞️🎬🔊📈🎨⏯️ +

https://www.youtube.com/watch?v=SLfff7Kw_Xc

+
+https://github.com/code-charity/youtube/wiki/Manual +
+ + - Fit Video to window, default resolution or pop-up player + - Hiding distractions + - Youtube Themes, Colors & night schedule + - Video Repeat-, screenshot-, rotate-buttons + - Customizable hotkeys / shortcuts + +
+
📟 "ImprovedTube Ticker 2022" /Pinned Issues - + ###### ❔[**ImprovedTube controls** in, under or around the video player or cursor](https://github.com/code4charity/YouTube-Extension/issues/1445).
❔[**Meaningful/Most similar extensions**? Social-Fixer, Youtube Enhancer, Simplify, ...](https://github.com/code4charity/YouTube-Extension/issues/1016).
📟 We are focused on updates, bugs & UX but please keep up your wishes for Features!
📟 Enjoy **our projects: global** [**Dark Mode**](https://chrome.google.com/webstore/detail/dark-mode/declgfomkjdohhjbcfemjklfebflhefl), to tweak CSS everywhere + Theme engine in the making, ...
📟 **2021:** Firefox, Edge, Opera, Whale added (please try&rate)
-
📜Historic Introduction @@ -278,17 +291,10 @@ _[Full list](https://github.com/ImprovedTube/YouTube/wiki/Features)_ |[Brave](https://brave.com)
Brave | [Chromium](https://github.com/chromium/chromium)
Chromium | [Chrome](https://chrome.google.com/webstore/detail/improve-youtube-open-sour/bnomihfieiccainjcjblhegjgglakjdd)
Chrome | [Edge](https://www.microsoft.com/edge)
Edge | [Firefox](https://foundation.mozilla.org)
Firefox | [Opera](https://addons.opera.com/en/extensions/details/install-chrome-extensions/)
Opera| [Safari](https://www.apple.com/safari/)
Safari | [Vivaldi](https://github.com/ric2b/Vivaldi-browser)
Vivaldi | | --------- | --------- | --------- | --------- | --------- | --------- | --------- | --------- | | 0.52+ | 49.0+ | 49.0+ | 79.0+ | 44.0+ | 36.0+ | x.x+ | 1.0+ | -
-🧰⋮⚙️🎛️☕🎧🎞️🎬🔊📈🎨⏯️...List of Features - - - Fit Video to window, default resolution or pop-up player - - Hiding distractions - - Youtube Themes, Colors & night schedule - - Video Repeat-, screenshot-, rotate-buttons - - Customizable hotkeys / shortcuts - -
-🔧 Installing from source +
+ +
+🔧 Installing from source 1.) **Download & extract the [[latest🧪version]](https://github.com/code4charity/YouTube-Extension/archive/refs/heads/master.zip) or [[release]](https://github.com/code-for-charity/YouTube-Extension/releases)** - **Safari**: From 07611c55918f325a340f5e999e9d458590faf01d Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sat, 27 Apr 2024 09:30:42 +0200 Subject: [PATCH 66/94] Update README.md --- .github/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/README.md b/.github/README.md index 043311567..6e79e4a9e 100644 --- a/.github/README.md +++ b/.github/README.md @@ -12,7 +12,7 @@ Donate · [Test🧪](https://github.com/code-for-charity/ImprovedTube-for-YouTube/archive/refs/heads/master.zip "Latest.zip")
/ImprovedTube/ a powerful but lightweight extension,
to enrich your video experience & enable your content selection. -

Please join us! Also, lets re-define [`browser extension`](https://en.wikipedia.org/wiki/Browser_extension)! Why are they often unfunded & neglected? +
Top ~ 60recommended by firefox g 'Might
be the only YouTube Extension you'll ever need'
'enhances YouTube in meaningful ways'
'Strong Add-on, full control. Yet clear & easy'

Thanks ♡ to our contributors, Alan Tan, Raszpl @@ -35,12 +35,11 @@ Today adding features can be easier & so motivating as there are 500 000 users. **W**hy arent there millions of users yet? We didn't write a guide or manual, let alone ads. This project can "fly much higher" through your word of mouth & eventually enable us to work on all wishes & immediate fixes around the clock🌱

Contributing

-For more info on how to contribute,
please see the contribution wiki. - - - +For more info on how to contribute, see the contribution wiki. +

Please join us! And let's re-define "extensions"! +Why are they often unfunded & neglected? -

🏷️Roadmap

+

🏷️Roadmap

- [ ] _Find developers, patreons_ - - [ ] _All [bugs](https://github.com/code4charity/YouTube-Extension/issues?q=label%3Abug+sort%3Acomments-desc+is%3Aopen+-label%3A_+), many [wishes](https://github.com/code4charity/YouTube-Extension/issues?q=label%3A%22Feature+Request%22+sort%3Acomments-desc+is%3Aopen+-label%3A_++-label%3A%22not+Goo.+Chrome%22+)_ From d41531c1658f90702d7977f97252fe6298cbd862 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 27 Apr 2024 14:29:41 +0200 Subject: [PATCH 67/94] Update general.css stop scrollbar-color from overriding ::-webkit-scrollbar fixes https://github.com/code-charity/youtube/issues/2195 --- js&css/extension/www.youtube.com/general/general.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js&css/extension/www.youtube.com/general/general.css b/js&css/extension/www.youtube.com/general/general.css index 439c59d90..338b8af88 100644 --- a/js&css/extension/www.youtube.com/general/general.css +++ b/js&css/extension/www.youtube.com/general/general.css @@ -166,6 +166,10 @@ html[it-pathname='/feed/subscriptions'][it-collapse-of-subscription-sections='tr --------------------------------------------------------------*/ html[it-scroll-bar=hidden] body {overflow-y: overlay;} html[it-scroll-bar=hidden] ::-webkit-scrollbar {display: none;} +html[it-scroll-bar=hidden], +html[it-scroll-bar=hidden][dark] { + scrollbar-color: unset; +} /*-------------------------------------------------------------- # ADD "SCROLL TO TOP" --------------------------------------------------------------*/ From a25a724a099e5916e183046fb1706ae330b291fa Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sat, 27 Apr 2024 16:41:15 +0200 Subject: [PATCH 68/94] #300 (#2162 #2212) please test --- .../web-accessible/www.youtube.com/player.js | 395 ++++++++---------- 1 file changed, 178 insertions(+), 217 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 6ed11a2a2..6fac74811 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -2,21 +2,21 @@ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ ImprovedTube.autoplayDisable = function () { - var video = ImprovedTube.elements.player; - if (ImprovedTube.video_url !== location.href) { - this.user_interacted = false; - } - // if (allow autoplay is false) and (no ads playing) and + var video = ImprovedTube.elements.player; + if (ImprovedTube.video_url !== location.href) { + this.user_interacted = false; + } + // if (allow autoplay is false) and (no ads playing) and // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and it is not in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) - if (!this.user_interacted && video.classList.contains('ad-showing') === false && - ( + if (!this.user_interacted && video.classList.contains('ad-showing') === false && + ( // quick fix #1703 thanks to @AirRaid#9957 - (/* document.documentElement.dataset.pageType === "video" */ location.href.indexOf('/watch?') !== -1 && ((location.href.indexOf('list=') === -1 && ImprovedTube.storage.player_autoplay_disable) || (ImprovedTube.storage.playlist_autoplay === false && location.href.indexOf('list=') !== -1))) || - (/* document.documentElement.dataset.pageType === "channel" */ ImprovedTube.regex.channel.test(location.href) && ImprovedTube.storage.channel_trailer_autoplay === false) - ) - ) + (/* document.documentElement.dataset.pageType === "video" */ location.href.indexOf('/watch?') !== -1 && ((location.href.indexOf('list=') === -1 && ImprovedTube.storage.player_autoplay_disable) || (ImprovedTube.storage.playlist_autoplay === false && location.href.indexOf('list=') !== -1))) || + (/* document.documentElement.dataset.pageType === "channel" */ ImprovedTube.regex.channel.test(location.href) && ImprovedTube.storage.channel_trailer_autoplay === false) + ) + ) {if (!ImprovedTube.autoplayDeniedOnce) { - setTimeout(function () { video.pauseVideo(); }); + setTimeout(function () { video.pauseVideo(); }); ImprovedTube.autoplayDeniedOnce = true; } else { console.log("autoplay:off - should we pause here again?"); } } }; @@ -74,7 +74,7 @@ ImprovedTube.playerPlaybackSpeed = function () { if (this.storage.player_forced_ if ( !player.getVideoData().isLive || player.getVideoData().isLive === false) { player.setPlaybackRate(Number(option)); video.playbackRate = Number(option); // #1729 q2 // hi! @raszpl if ( (this.storage.player_force_speed_on_music !== true || this.storage.player_dont_speed_education === true) - && option !== 1) { + && option !== 1) { ImprovedTube.speedException = function () { if (this.storage.player_dont_speed_education === true && DATA.genre === 'Education') {player.setPlaybackRate(Number(1)); video.playbackRate = Number(1); return;} @@ -93,7 +93,7 @@ var musicRegexMatch = musicIdentifiersTitle.test(DATA.title); keywordsAmount = 1 + ((keywords || '').match(/,/) || []).length; if ( ((keywords || '').match(musicIdentifiersTags) || []).length / keywordsAmount > 0.08) { musicRegexMatch = true}} -notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(DATA.title + " " + keywords); +notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(DATA.title + " " + keywords); // (Tags/keywords shouldnt lie & very few songs titles might have these words) if (DATA.duration) { function parseDuration(duration) { const [_, h = 0, m = 0, s = 0] = duration.match(/PT(?:(\d+)?H)?(?:(\d+)?M)?(\d+)?S?/).map(part => parseInt(part) || 0); @@ -121,13 +121,13 @@ console.log("genre: " + DATA.genre + "//title: " + DATA.title + "//keywords: " // || location.href.indexOf('music.') !== -1 // (=currently we are only running on www.youtube.com anyways) ) { player.setPlaybackRate(1); video.playbackRate = 1; console.log ("...,thus must be music?"); } else { // Now this video might rarely be music - // - however we can make extra-sure after waiting for the video descripion to load... (#1539) + // - however we can make extra-sure after waiting for the video descripion to load... (#1539) var tries = 0; var intervalMs = 210; if (location.href.indexOf('/watch?') !== -1) {var maxTries = 10;} else {var maxTries = 0;} // ...except when it is an embedded player? var waitForDescription = setInterval(() => { if (++tries >= maxTries) { subtitle = document.querySelector('#title + #subtitle:last-of-type') - if ( subtitle && 1 <= Number((subtitle?.innerHTML?.match(/^\d+/) || [])[0]) // indicates buyable/registered music (amount of songs) + if ( subtitle && 1 <= Number((subtitle?.innerHTML?.match(/^\d+/) || [])[0]) // indicates buyable/registered music (amount of songs) && typeof testSongDuration(DATA.lengthSeconds, Number((subtitle?.innerHTML?.match(/^\d+/) || [])[0]) ) !== 'undefined' ) // resonable duration {player.setPlaybackRate(1); video.playbackRate = 1; console.log("...but YouTube shows music below the description!"); clearInterval(waitForDescription); } intervalMs *= 1.11; }}, intervalMs); @@ -143,12 +143,12 @@ DATA.videoID = ImprovedTube.videoId() || false; // if (history.length > 1 && history.state.endpoint.watchEndpoint) { try { DATA = JSON.parse(document.querySelector('#microformat script')?.textContent) ?? false; DATA.title = DATA.name;} catch { DATA.genre = false; DATA.keywords = false; DATA.lengthSeconds = false; - try { - DATA.title = document.getElementsByTagName('meta')?.title?.content || false; - DATA.genre = document.querySelector('meta[itemprop=genre]')?.content || false; - DATA.duration = document.querySelector('meta[itemprop=duration]')?.content || false; + try { + DATA.title = document.getElementsByTagName('meta')?.title?.content || false; + DATA.genre = document.querySelector('meta[itemprop=genre]')?.content || false; + DATA.duration = document.querySelector('meta[itemprop=duration]')?.content || false; } catch {}} if ( DATA.title === ImprovedTube.videoTitle() ) - { keywords = document.getElementsByTagName('meta')?.keywords?.content || false; if(!keywords){keyword=''} ImprovedTube.speedException(); } + { keywords = document.getElementsByTagName('meta')?.keywords?.content || false; if(!keywords){keyword=''} ImprovedTube.speedException(); } else { keywords = ''; (async function () { try { const response = await fetch(`https://www.youtube.com/watch?v=${DATA.videoID}`); const htmlContent = await response.text(); @@ -169,22 +169,22 @@ else { const invidiousInstances = ['iv.datura.network', 'vid.puffyan.us', 'invidious.perennialte.ch', 'iv.melmac.space', 'inv.in.projectsegfau.lt', 'invidious.asir.dev', 'inv.zzls.xyz', 'invidious.io.lol', 'onion.tube', 'yewtu.be', 'invidious.protokolla.fi', 'inv.citw.lgbt', 'anontube.lvkaszus.pl', 'iv.nboeck.de', 'invidious.no-logs.com', 'vid.priv.au', 'yt.cdaut.de', 'invidious.slipfox.xyz', 'yt.artemislena.eu', 'invidious.drgns.space', 'invidious.einfachzocken.eu', 'invidious.projectsegfau.lt', 'invidious.nerdvpn.de', 'invidious.private.coffee', 'invidious.lunar.icu', 'invidious.privacydev.net', 'invidious.fdn.fr', 'yt.oelrichsgarcia.de', 'iv.ggtyler.dev', 'inv.tux.pizza', 'yt.drgnz.club', 'inv.us.projectsegfau.lt']; function getRandomInvidiousInstance() { return invidiousInstances[Math.floor(Math.random() * invidiousInstances.length)];} -(async function () { let retries = 5; let invidiousFetched = false; - async function fetchInvidiousData() { - try {const response = await fetch(`https://${getRandomInvidiousInstance()}/api/v1/videos/${DATA.videoID}?fields=genre,title,lengthSeconds,keywords`); - DATA = await response.json(); - if (DATA.genre && DATA.title && DATA.keywords && DATA.lengthSeconds) { if (DATA.keywords.toString() === defaultKeywords ) {DATA.keywords = ''} - ImprovedTube.speedException(); invidiousFetched = true; } - } catch (error) { console.error('Error: Invidious API: ', error); } - } - while (retries > 0 && !invidiousFetched) { await fetchInvidiousData(); - if (!invidiousFetched) { await new Promise(resolve => setTimeout(resolve, retries === 5 ? 1234 : 432)); retries--; } } +(async function () { let retries = 5; let invidiousFetched = false; + async function fetchInvidiousData() { + try {const response = await fetch(`https://${getRandomInvidiousInstance()}/api/v1/videos/${DATA.videoID}?fields=genre,title,lengthSeconds,keywords`); + DATA = await response.json(); + if (DATA.genre && DATA.title && DATA.keywords && DATA.lengthSeconds) { if (DATA.keywords.toString() === defaultKeywords ) {DATA.keywords = ''} + ImprovedTube.speedException(); invidiousFetched = true; } + } catch (error) { console.error('Error: Invidious API: ', error); } + } + while (retries > 0 && !invidiousFetched) { await fetchInvidiousData(); + if (!invidiousFetched) { await new Promise(resolve => setTimeout(resolve, retries === 5 ? 1234 : 432)); retries--; } } if(!invidiousFetched){ if (document.readyState === 'loading') {document.addEventListener('DOMContentLoaded', ImprovedTube.fetchDOMData())} else { ImprovedTube.fetchDOMData();} } })(); } - } // else { } - } + } // else { } + } } } /*------------------------------------------------------------------------------ @@ -203,28 +203,28 @@ ImprovedTube.subtitles = function () { SUBTITLES LANGUAGE ------------------------------------------------------------------------------*/ ImprovedTube.subtitlesLanguage = function () { - var option = this.storage.subtitles_language; - if (this.isset(option) && option !== 'default') { - var player = this.elements.player, - button = this.elements.player_subtitles_button; - - if (player && player.getOption && button && button.getAttribute('aria-pressed') === 'true') { - var tracklist = this.elements.player.getOption('captions', 'tracklist', { - includeAsr: true - }); - - var matchTrack = false; - for (var i =0, l = tracklist.length; i resolution[label.indexOf(q)]); + quality = closest(resolution[label.indexOf(quality)], availableresolutions); + quality = label[resolution.indexOf(quality)]; + } + player.setPlaybackQualityRange(quality); + player.setPlaybackQuality(quality); + player.dataset.defaultQuality = quality; + } + } }; /*------------------------------------------------------------------------------ QUALITY WITHOUT FOCUS ------------------------------------------------------------------------------*/ ImprovedTube.playerQualityWithoutFocus = function () { - function closest (num, arr) { - let curr = arr[0]; - let diff = Math.abs (num - curr); - for (let val = 0; val < arr.length; val++) { - let newdiff = Math.abs (num - arr[val]); - if (newdiff < diff) { - diff = newdiff; - curr = arr[val]; - } - } - return curr; - }; - var player = this.elements.player, - qualityWithoutFocus = this.storage.player_quality_without_focus; - quality = this.storage.player_quality; - if(qualityWithoutFocus && qualityWithoutFocus != 'disabled' && player){ - if(this.focus === false) { - var available_quality_levels = player.getAvailableQualityLevels(); - if (available_quality_levels.includes(qualityWithoutFocus) === false) { - let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; - let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; - let availableresolutions = available_quality_levels.reduce(function (array, elem) { - array.push(resolution[label.indexOf(elem)]); return array; - }, []); - - qualityWithoutFocus = closest (resolution[label.indexOf(qualityWithoutFocus)], availableresolutions); - qualityWithoutFocus = label[resolution.indexOf(qualityWithoutFocus)]; - } - - player.setPlaybackQualityRange(qualityWithoutFocus); - player.setPlaybackQuality(qualityWithoutFocus); - - } - if (this.focus === true){ - var available_quality_levels = player.getAvailableQualityLevels(); - if (available_quality_levels.includes(quality) === false) { - let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; - let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; - let availableresolutions = available_quality_levels.reduce(function (array, elem) { - array.push(resolution[label.indexOf(elem)]); return array; - }, []); - - quality = closest (resolution[label.indexOf(quality)], availableresolutions); - quality = label[resolution.indexOf(quality)]; - } - - player.setPlaybackQualityRange(quality); - player.setPlaybackQuality(quality); - } - } - + var qualityWithoutFocus = this.storage.player_quality_without_focus; + if (qualityWithoutFocus && qualityWithoutFocus !== 'disabled') { + if (this.focus === true) { + if (ImprovedTube.qualityBeforeBlur) { + ImprovedTube.playerQuality(ImprovedTube.qualityBeforeBlur); + } else { + ImprovedTube.playerQuality(); + } + } else if (this.focus === false) { + ImprovedTube.qualityBeforeBlur = this.elements.player.getPlaybackQuality(); + if (ImprovedTube.played_time > 0 && ImprovedTube.formatSecond(player.getDuration() * 0.997 - player.getCurrentTime()) > 11) { + setTimeout(function () { + if (this.focus === false) { + ImprovedTube.playerQuality(qualityWithoutFocus); + } + }, Math.max(321, 3210 - ImprovedTube.played_time)); + } + } + } }; /*------------------------------------------------------------------------------ FORCED VOLUME ------------------------------------------------------------------------------*/ ImprovedTube.playerVolume = function () { - if (this.storage.player_forced_volume === true) { - var volume = this.storage.player_volume; + if (this.storage.player_forced_volume === true) { + var volume = this.storage.player_volume; - if (!this.isset(volume)) { - volume = 100; - } else { - volume = Number(volume); - } + if (!this.isset(volume)) { + volume = 100; + } else { + volume = Number(volume); + } - if (!this.audioContextGain && volume <= 100) { - if (this.audioContext) { - this.audioContext.close(); - } + if (!this.audioContextGain && volume <= 100) { + if (this.audioContext) { + this.audioContext.close(); + } - this.elements.player.setVolume(volume); - } else { - if (!this.audioContext) { - this.audioContext = new AudioContext(); + this.elements.player.setVolume(volume); + } else { + if (!this.audioContext) { + this.audioContext = new AudioContext(); - this.audioContextSource = this.audioContext.createMediaElementSource(document.querySelector('video')); - this.audioContextGain = this.audioContext.createGain(); + this.audioContextSource = this.audioContext.createMediaElementSource(document.querySelector('video')); + this.audioContextGain = this.audioContext.createGain(); - this.audioContextGain.gain.value = 1; - this.audioContextSource.connect(this.audioContextGain); - this.audioContextGain.connect(this.audioContext.destination) - } + this.audioContextGain.gain.value = 1; + this.audioContextSource.connect(this.audioContextGain); + this.audioContextGain.connect(this.audioContext.destination) + } if (this.elements.player.getVolume() !== 100) { this.elements.player.setVolume(100);} - this.audioContextGain.gain.value = volume / 100; - } - } + this.audioContextGain.gain.value = volume / 100; + } + } }; /*------------------------------------------------------------------------------ LOUDNESS NORMALIZATION @@ -690,7 +651,7 @@ ImprovedTube.screenshot = function () { a.href = URL.createObjectURL(blob); console.log("screeeeeeenshot tada!"); - a.download = (ImprovedTube.videoId() || location.href.match) + ' ' + new Date(ImprovedTube.elements.player.getCurrentTime() * 1000).toISOString().substr(11, 8).replace(/:/g, '-') + ' ' + ImprovedTube.videoTitle() + (subText ? ' - ' + subText.trim() : '') + '.png'; + a.download = (ImprovedTube.videoId() || location.href.match) + ' ' + new Date(ImprovedTube.elements.player.getCurrentTime() * 1000).toISOString().substr(11, 8).replace(/:/g, '-') + ' ' + ImprovedTube.videoTitle() + (subText ? ' - ' + subText.trim() : '') + '.png'; a.click(); } else { @@ -707,28 +668,28 @@ ImprovedTube.screenshot = function () { }; ImprovedTube.renderSubtitle = function (ctx,captionElements) { - if (ctx && captionElements) { - captionElements.forEach(function (captionElement, index) { - var captionText = captionElement.textContent.trim(); - var captionStyles = window.getComputedStyle(captionElement); - - ctx.fillStyle = captionStyles.color; - ctx.font = captionStyles.font; - ctx.textAlign = 'center'; - ctx.textBaseline = 'bottom'; - var txtWidth = ctx.measureText(captionText).width; - var txtHeight = parseFloat(captionStyles.fontSize); - - var xOfset = (ctx.canvas.width - txtWidth) / 2; - - var padding = 5; // Adjust the padding as needed - var yofset = ctx.canvas.height - (captionElements.length - index) * (txtHeight + 2 * padding); - - ctx.fillStyle = captionStyles.backgroundColor; - ctx.fillRect(xOfset - padding, yofset - txtHeight - padding, txtWidth + 2 * padding, txtHeight + 2 * padding); - ctx.fillStyle = captionStyles.color; - ctx.fillText(captionText, xOfset + txtWidth / 2, yofset); - }); + if (ctx && captionElements) { + captionElements.forEach(function (captionElement, index) { + var captionText = captionElement.textContent.trim(); + var captionStyles = window.getComputedStyle(captionElement); + + ctx.fillStyle = captionStyles.color; + ctx.font = captionStyles.font; + ctx.textAlign = 'center'; + ctx.textBaseline = 'bottom'; + var txtWidth = ctx.measureText(captionText).width; + var txtHeight = parseFloat(captionStyles.fontSize); + + var xOfset = (ctx.canvas.width - txtWidth) / 2; + + var padding = 5; // Adjust the padding as needed + var yofset = ctx.canvas.height - (captionElements.length - index) * (txtHeight + 2 * padding); + + ctx.fillStyle = captionStyles.backgroundColor; + ctx.fillRect(xOfset - padding, yofset - txtHeight - padding, txtWidth + 2 * padding, txtHeight + 2 * padding); + ctx.fillStyle = captionStyles.color; + ctx.fillText(captionText, xOfset + txtWidth / 2, yofset); + }); } }; @@ -754,13 +715,13 @@ ImprovedTube.playerScreenshotButton = function () { /*------------------------------------------------------------------------------ REPEAT -------------------------------------------------------------------------------*/ -ImprovedTube.playerRepeat = function () { +ImprovedTube.playerRepeat = function () { setTimeout(function () { if (!/ad-showing/.test(ImprovedTube.elements.player.className)) { ImprovedTube.elements.video.setAttribute('loop', ''); } //ImprovedTube.elements.buttons['it-repeat-styles'].style.opacity = '1'; //old class from version 3.x? that both repeat buttons could have - }, 200); + }, 200); } /*------------------------------------------------------------------------------ REPEAT BUTTON @@ -772,7 +733,7 @@ ImprovedTube.playerRepeatButton = function (node) { svg.setAttributeNS(null, 'viewBox', '0 0 24 24'); path.setAttributeNS(null, 'd', 'M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4zm-4-2V9h-1l-2 1v1h1.5v4H13z'); svg.appendChild(path); - var transparentOrOn = 0.5; if (this.storage.player_always_repeat === true ) { transparentOrOn = 1; } + var transparentOrOn = 0.5; if (this.storage.player_always_repeat === true ) { transparentOrOn = 1; } this.createPlayerButton({ id: 'it-repeat-button', child: svg, @@ -781,7 +742,7 @@ ImprovedTube.playerRepeatButton = function (node) { var video = ImprovedTube.elements.video; function matchLoopState(opacity) { var thisButton = document.querySelector('#it-repeat-button'); - thisButton.style.opacity = opacity; + thisButton.style.opacity = opacity; if (ImprovedTube.storage.below_player_loop !== false) { var otherButton = document.querySelector('#it-below-player-loop'); otherButton.children[0].style.opacity = opacity; @@ -857,10 +818,10 @@ FIT-TO-WIN BUTTON ------------------------------------------------------------------------------*/ ImprovedTube.playerFitToWinButton = function () { if (this.storage.player_fit_to_win_button === true && (/watch\?/.test(location.href))) { - let tempContainer = document.createElement("div"); - tempContainer.innerHTML = ` + let tempContainer = document.createElement("div"); + tempContainer.innerHTML = ` `; - const svg = tempContainer.firstChild; + const svg = tempContainer.firstChild; this.createPlayerButton({ id: 'it-fit-to-win-player-button', child: svg, @@ -993,17 +954,17 @@ ImprovedTube.playerCinemaModeEnable = function () { HAMBURGER MENU ------------------------------------------------------------------------------*/ ImprovedTube.playerHamburgerButton = function () { if(this.storage.player_hamburger_button === true){ - const videoPlayer = document.querySelector('.html5-video-player'); + const videoPlayer = document.querySelector('.html5-video-player'); - if (!videoPlayer) { - return; - } + if (!videoPlayer) { + return; + } - const controlsContainer = videoPlayer.querySelector('.ytp-right-controls'); + const controlsContainer = videoPlayer.querySelector('.ytp-right-controls'); - if (!controlsContainer) { - return; - } + if (!controlsContainer) { + return; + } let hamburgerMenu = document.querySelector('.custom-hamburger-menu'); if (!hamburgerMenu) { @@ -1107,20 +1068,20 @@ ImprovedTube.playerSDR = function () { Hide controls ------------------------------------------------------------------------------*/ ImprovedTube.playerControls = function (pause=false) { - var player = this.elements.player; if (player) { + var player = this.elements.player; if (player) { let hide = this.storage.player_hide_controls; - if (hide === 'always') { - player.hideControls(); - } else if(hide === 'off') { - player.showControls(); - } else if(hide === 'when_paused') { + if (hide === 'always') { + player.hideControls(); + } else if(hide === 'off') { + player.showControls(); + } else if(hide === 'when_paused') { if(this.elements.video.paused){ - player.hideControls( ); + player.hideControls( ); ImprovedTube.elements.player.parentNode.addEventListener('mouseenter', function () { player.showControls();}); ImprovedTube.elements.player.parentNode.addEventListener('mouseleave', function () { - player.hideControls( );}); + player.hideControls( );}); ImprovedTube.elements.player.parentNode.onmousemove = (function() { @@ -1137,7 +1098,7 @@ ImprovedTube.playerControls = function (pause=false) { }} else { player.showControls(); } } }; -/*# HIDE VIDEO TITLE IN FULLSCREEN */ // Easier with CSS only (see player.css) +/*# HIDE VIDEO TITLE IN FULLSCREEN */ // Easier with CSS only (see player.css) //ImprovedTube.hideVideoTitleFullScreen = function (){ if (ImprovedTube.storage.hide_video_title_fullScreen === true) { //document.addEventListener('fullscreenchange', function (){ document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'none'); }) }}; @@ -1145,18 +1106,18 @@ ImprovedTube.playerControls = function (pause=false) { CUSTOM MINI-PLAYER ------------------------------------------------------------------------------*/ ImprovedTube.mini_player__setSize = function (width, height, keep_ar, keep_area) { - if (keep_ar) { - const aspect_ratio = ImprovedTube.elements.video.style.width.replace('px', '') / ImprovedTube.elements.video.style.height.replace('px', ''); - if (keep_area) { - height = Math.sqrt((width * height) / aspect_ratio); - width = height * aspect_ratio; - } else { - height = width / aspect_ratio; - } - } + if (keep_ar) { + const aspect_ratio = ImprovedTube.elements.video.style.width.replace('px', '') / ImprovedTube.elements.video.style.height.replace('px', ''); + if (keep_area) { + height = Math.sqrt((width * height) / aspect_ratio); + width = height * aspect_ratio; + } else { + height = width / aspect_ratio; + } + } - ImprovedTube.elements.player.style.width = width + 'px'; - ImprovedTube.elements.player.style.height = height + 'px'; + ImprovedTube.elements.player.style.width = width + 'px'; + ImprovedTube.elements.player.style.height = height + 'px'; }; ImprovedTube.miniPlayer_scroll = function () { From 40aedd46e11aa1d14854c5bb0cd067ce98c20336 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sat, 27 Apr 2024 18:57:21 +0200 Subject: [PATCH 69/94] will HTMLMediaElement timeupdate run faster than 4hz? https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event --- js&css/web-accessible/functions.js | 98 +++++++++++-------- .../web-accessible/www.youtube.com/player.js | 2 +- 2 files changed, 56 insertions(+), 44 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 372d58777..7c62691da 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -29,7 +29,7 @@ ImprovedTube.childHandler = function (node) { //console.log(node.nodeName); //console.log("node.nodeName:CHILD-"+i+":"+children[i].id+",class:"+children[i].className+","+children[i]+"("+children[i].nodeName+")"); i++; } - } + } }; */ ImprovedTube.ytElementsHandler = function (node) { @@ -47,31 +47,31 @@ ImprovedTube.ytElementsHandler = function (node) { this.blocklist('channel', node); } } - } /* else if (name === 'META') { // infos are not updated when clicking related videos... - if(node.getAttribute('name')) { - //if(node.getAttribute('name') === 'title') {ImprovedTube.title = node.content;} //duplicate - //if(node.getAttribute('name') === 'description') {ImprovedTube.description = node.content;} //duplicate - //if node.getAttribute('name') === 'themeColor') {ImprovedTube.themeColor = node.content;} //might help our darkmode/themes + } /* else if (name === 'META') { // infos are not updated when clicking related videos... + if(node.getAttribute('name')) { + //if(node.getAttribute('name') === 'title') {ImprovedTube.title = node.content;} //duplicate + //if(node.getAttribute('name') === 'description') {ImprovedTube.description = node.content;} //duplicate + //if node.getAttribute('name') === 'themeColor') {ImprovedTube.themeColor = node.content;} //might help our darkmode/themes //Do we need any of these here before the player starts? - //if(node.getAttribute('name') === 'keywords') {ImprovedTube.keywords = node.content;} - } else if (node.getAttribute('itemprop')) { - //if(node.getAttribute('itemprop') === 'name') {ImprovedTube.title = node.content;} - if(node.getAttribute('itemprop') === 'genre') {ImprovedTube.category = node.content;} - //if(node.getAttribute('itemprop') === 'channelId') {ImprovedTube.channelId = node.content;} - //if(node.getAttribute('itemprop') === 'videoId') {ImprovedTube.videoId = node.content;} + //if(node.getAttribute('name') === 'keywords') {ImprovedTube.keywords = node.content;} + } else if (node.getAttribute('itemprop')) { + //if(node.getAttribute('itemprop') === 'name') {ImprovedTube.title = node.content;} + if(node.getAttribute('itemprop') === 'genre') {ImprovedTube.category = node.content;} + //if(node.getAttribute('itemprop') === 'channelId') {ImprovedTube.channelId = node.content;} + //if(node.getAttribute('itemprop') === 'videoId') {ImprovedTube.videoId = node.content;} //The following infos will enable awesome, smart features. Some of which everyone should use. - //if(node.getAttribute('itemprop') === 'description') {ImprovedTube.description = node.content;} - //if(node.getAttribute('itemprop') === 'duration') {ImprovedTube.duration = node.content;} - //if(node.getAttribute('itemprop') === 'interactionCount'){ImprovedTube.views = node.content;} - //if(node.getAttribute('itemprop') === 'isFamilyFriendly'){ImprovedTube.isFamilyFriendly = node.content;} - //if(node.getAttribute('itemprop') === 'unlisted') {ImprovedTube.unlisted = node.content;} - //if(node.getAttribute('itemprop') === 'regionsAllowed'){ImprovedTube.regionsAllowed = node.content;} - //if(node.getAttribute('itemprop') === 'paid') {ImprovedTube.paid = node.content;} - // if(node.getAttribute('itemprop') === 'datePublished' ){ImprovedTube.datePublished = node.content;} - //to use in the "how long ago"-feature, not to fail without API key? just like the "day-of-week"-feature above - // if(node.getAttribute('itemprop') === 'uploadDate') {ImprovedTube.uploadDate = node.content;} - } - } */ + //if(node.getAttribute('itemprop') === 'description') {ImprovedTube.description = node.content;} + //if(node.getAttribute('itemprop') === 'duration') {ImprovedTube.duration = node.content;} + //if(node.getAttribute('itemprop') === 'interactionCount'){ImprovedTube.views = node.content;} + //if(node.getAttribute('itemprop') === 'isFamilyFriendly'){ImprovedTube.isFamilyFriendly = node.content;} + //if(node.getAttribute('itemprop') === 'unlisted') {ImprovedTube.unlisted = node.content;} + //if(node.getAttribute('itemprop') === 'regionsAllowed'){ImprovedTube.regionsAllowed = node.content;} + //if(node.getAttribute('itemprop') === 'paid') {ImprovedTube.paid = node.content;} + // if(node.getAttribute('itemprop') === 'datePublished' ){ImprovedTube.datePublished = node.content;} + //to use in the "how long ago"-feature, not to fail without API key? just like the "day-of-week"-feature above + // if(node.getAttribute('itemprop') === 'uploadDate') {ImprovedTube.uploadDate = node.content;} + } + } */ else if (name === 'YTD-TOGGLE-BUTTON-RENDERER' || name === 'YTD-PLAYLIST-LOOP-BUTTON-RENDERER') { //can be precise previously node.parentComponent & node.parentComponent.parentComponent if (node.closest("YTD-MENU-RENDERER") @@ -264,11 +264,11 @@ ImprovedTube.ytElementsHandler = function (node) { ImprovedTube.chapters(node); }, 200); } /* else if (name === 'TP-YT-PAPER-BUTTON') { - if ( (id === 'expand-sizer' || id === 'expand') && node.parentNode.id === 'description-inline-expander') { - setTimeout(function () { - ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY") - }, 750); - }} */ + if ( (id === 'expand-sizer' || id === 'expand') && node.parentNode.id === 'description-inline-expander') { + setTimeout(function () { + ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY") + }, 750); + }} */ } }; @@ -387,23 +387,35 @@ ImprovedTube.initPlayer = function () { } }; -ImprovedTube.playerOnTimeUpdate = function () { - if (ImprovedTube.video_src !== this.src) { - ImprovedTube.video_src = this.src; - - if (ImprovedTube.initialVideoUpdateDone !== true) { - ImprovedTube.playerQuality(); - } - } else if (ImprovedTube.latestVideoDuration !== this.duration) { - ImprovedTube.latestVideoDuration = this.duration; +var timeUpdateInterval = null; +var noTimeUpdate = null; - ImprovedTube.playerQuality(); - } +ImprovedTube.playerOnTimeUpdate = function() { + var currentTime = Date.now(); + if (!timeUpdateInterval) { + timeUpdateInterval = setInterval(function() { + if (ImprovedTube.video_src !== this.src) { + ImprovedTube.video_src = this.src; - ImprovedTube.alwaysShowProgressBar(); - ImprovedTube.playerRemainingDuration(); + if (ImprovedTube.initialVideoUpdateDone !== true) { + ImprovedTube.playerQuality(); + } + } else if (ImprovedTube.latestVideoDuration !== this.duration) { + ImprovedTube.latestVideoDuration = this.duration; + + ImprovedTube.playerQuality(); + } - ImprovedTube.played_time += .25; + ImprovedTube.alwaysShowProgressBar(); + ImprovedTube.playerRemainingDuration(); + ImprovedTube.played_time += .5; + }, 500); + } + clearInterval(noTimeUpdate); + noTimeUpdate = setTimeout(function() { + clearInterval(timeUpdateInterval); + timeUpdateInterval = null; + }, 987); }; ImprovedTube.playerOnLoadedMetadata = function () { diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 6fac74811..aa9ba3135 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -495,7 +495,7 @@ ImprovedTube.playerAutofullscreen = function () { QUALITY ------------------------------------------------------------------------------*/ ImprovedTube.playerQuality = function (quality) { - if (!quality) var quality = this.storage.player_quality; + if (!quality) quality = this.storage.player_quality; if (quality && quality !== 'auto') { var player = this.elements.player; if (player && player.getAvailableQualityLevels && !player.dataset.defaultQuality) { From 5009df8d64c75840c838e6242be5b7fb063447d0 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 28 Apr 2024 15:15:53 +0200 Subject: [PATCH 70/94] Update player.js fixed playerQualityWithoutFocus --- .../web-accessible/www.youtube.com/player.js | 93 +++++++++---------- 1 file changed, 43 insertions(+), 50 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index aa9ba3135..b8328b770 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -494,60 +494,53 @@ ImprovedTube.playerAutofullscreen = function () { /*------------------------------------------------------------------------------ QUALITY ------------------------------------------------------------------------------*/ -ImprovedTube.playerQuality = function (quality) { - if (!quality) quality = this.storage.player_quality; - if (quality && quality !== 'auto') { - var player = this.elements.player; - if (player && player.getAvailableQualityLevels && !player.dataset.defaultQuality) { - var available_quality_levels = player.getAvailableQualityLevels(); - function closest(num, arr) { - let curr = arr[0]; - let diff = Math.abs(num - curr); - for (let val = 0; val < arr.length; val++) { - let newdiff = Math.abs(num - arr[val]); - if (newdiff < diff) { - diff = newdiff; - curr = arr[val]; - } - } - return curr; - } - if (!available_quality_levels.includes(quality)) { - let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; - let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; - let availableresolutions = available_quality_levels.map(q => resolution[label.indexOf(q)]); - quality = closest(resolution[label.indexOf(quality)], availableresolutions); - quality = label[resolution.indexOf(quality)]; - } - player.setPlaybackQualityRange(quality); - player.setPlaybackQuality(quality); - player.dataset.defaultQuality = quality; - } - } +ImprovedTube.playerQuality = function (quality = this.storage.player_quality) { + let player = this.elements.player; + if (quality && player && player.getAvailableQualityLevels + && (!player.dataset.defaultQuality || player.dataset.defaultQuality != quality)) { + let available_quality_levels = player.getAvailableQualityLevels(); + function closest(num, arr) { + let curr = arr[0]; + let diff = Math.abs(num - curr); + for (let val = 1; val < arr.length; val++) { + let newdiff = Math.abs(num - arr[val]); + if (newdiff < diff) { + diff = newdiff; + curr = arr[val]; + } + } + return curr; + }; + + if (!available_quality_levels.includes(quality)) { + let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; + let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; + let availableresolutions = available_quality_levels.map(q => resolution[label.indexOf(q)]); + quality = label[resolution.indexOf(closest(resolution[label.indexOf(quality)], availableresolutions))]; + } + player.setPlaybackQualityRange(quality); + player.setPlaybackQuality(quality); + player.dataset.defaultQuality = quality; + } }; /*------------------------------------------------------------------------------ QUALITY WITHOUT FOCUS ------------------------------------------------------------------------------*/ ImprovedTube.playerQualityWithoutFocus = function () { - var qualityWithoutFocus = this.storage.player_quality_without_focus; - if (qualityWithoutFocus && qualityWithoutFocus !== 'disabled') { - if (this.focus === true) { - if (ImprovedTube.qualityBeforeBlur) { - ImprovedTube.playerQuality(ImprovedTube.qualityBeforeBlur); - } else { - ImprovedTube.playerQuality(); - } - } else if (this.focus === false) { - ImprovedTube.qualityBeforeBlur = this.elements.player.getPlaybackQuality(); - if (ImprovedTube.played_time > 0 && ImprovedTube.formatSecond(player.getDuration() * 0.997 - player.getCurrentTime()) > 11) { - setTimeout(function () { - if (this.focus === false) { - ImprovedTube.playerQuality(qualityWithoutFocus); - } - }, Math.max(321, 3210 - ImprovedTube.played_time)); - } - } - } + let player = this.elements.player, + qualityWithoutFocus = this.storage.player_quality_without_focus; + if (qualityWithoutFocus && qualityWithoutFocus !== 'auto' && player && player.getPlaybackQuality) { + if (this.focus) { + if (ImprovedTube.qualityBeforeBlur) { + ImprovedTube.playerQuality(ImprovedTube.qualityBeforeBlur); + } + } else { + if (!ImprovedTube.elements.video.paused) { + ImprovedTube.qualityBeforeBlur = player.getPlaybackQuality(); + ImprovedTube.playerQuality(qualityWithoutFocus); + } + } + } }; /*------------------------------------------------------------------------------ FORCED VOLUME @@ -1442,4 +1435,4 @@ ImprovedTube.miniPlayer = function () { window.removeEventListener('scroll', this.miniPlayer_scroll); window.removeEventListener('mousemove', this.miniPlayer_cursorUpdate); } -}; \ No newline at end of file +}; From 0d96050291565b0c4327990263a30cbd98fd2751 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 28 Apr 2024 15:18:53 +0200 Subject: [PATCH 71/94] Update player.js reuse player_quality options and on.render function --- menu/skeleton-parts/player.js | 59 +++-------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/menu/skeleton-parts/player.js b/menu/skeleton-parts/player.js index d82fc85bf..a778f576e 100644 --- a/menu/skeleton-parts/player.js +++ b/menu/skeleton-parts/player.js @@ -764,63 +764,12 @@ extension.skeleton.main.layers.section.player.on.click = { component: 'select', text: 'qualityWithoutFocus', id: 'player_quality_without_focus', - options: [{ - text: 'disabled', - value: 'disabled' - }, { - text: '144p', - value: 'tiny' - }, { - text: '240p', - value: 'small' - }, { - text: '360p', - value: 'medium' - }, { - text: '480p', - value: 'large' - }, { - text: '720p', - value: 'hd720' - }, { - text: '1080p', - value: 'hd1080' - }, { - text: '1440p', - value: 'hd1440' - }, { - text: '2160p', - value: 'hd2160' - }, { - text: '2880p', - value: 'hd2880' - }, { - text: '4320p', - value: 'highres' - }], + options: function () { + return extension.skeleton.main.layers.section.player.on.click.section_1.player_quality.options; + }, on: { render: function () { - if (satus.storage.get('player_h264')) { - if (this.childNodes[2].selectedIndex >6) { - this.childNodes[1].style = 'color: red!important; font-weight: bold;'; - this.childNodes[1].textContent = '1080p'; - } else { - this.childNodes[1].style = ''; - this.childNodes[1].textContent = this.childNodes[2].options[this.childNodes[2].selectedIndex].text; - } - for (let index =7; index <= 10; index++) { - this.childNodes[2].childNodes[index].style = 'color: red!important; font-weight: bold;'; - } - } else if (satus.storage.get('block_vp9') && satus.storage.get('block_h264')) { - this.childNodes[1].style = 'color: red!important; font-weight: bold;'; - this.childNodes[1].textContent = 'Video disabled'; - } else { - this.childNodes[1].style = ''; - this.childNodes[1].textContent = this.childNodes[2].options[this.childNodes[2].selectedIndex].text; - for (let index =7; index <= 10; index++) { - this.childNodes[2].childNodes[index].style = ''; - } - } + extension.skeleton.main.layers.section.player.on.click.section_1.player_quality.on.render.call(this); } } }, From 8dce00091adc438b6a651d7524cb573311b51683 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 28 Apr 2024 15:51:01 +0200 Subject: [PATCH 72/94] Update player.js qualityWithoutFocus explicit disable --- menu/skeleton-parts/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/skeleton-parts/player.js b/menu/skeleton-parts/player.js index a778f576e..aa40911a9 100644 --- a/menu/skeleton-parts/player.js +++ b/menu/skeleton-parts/player.js @@ -765,7 +765,7 @@ extension.skeleton.main.layers.section.player.on.click = { text: 'qualityWithoutFocus', id: 'player_quality_without_focus', options: function () { - return extension.skeleton.main.layers.section.player.on.click.section_1.player_quality.options; + return [{value: 'auto', text: "Disabled"}].concat(extension.skeleton.main.layers.section.player.on.click.section_1.player_quality.options.slice(1)); }, on: { render: function () { From cf067c631cbf7ee92b16f509c80899aead3312b0 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sun, 28 Apr 2024 19:00:24 +0200 Subject: [PATCH 73/94] typos --- _locales/el/messages.json | 2 +- .../www.youtube.com/general/general.css | 2 +- .../web-accessible/www.youtube.com/player.js | 395 ++++++++++-------- menu/skeleton-parts/search.js | 4 +- 4 files changed, 221 insertions(+), 182 deletions(-) diff --git a/_locales/el/messages.json b/_locales/el/messages.json index 4d9c4b059..c844ca117 100644 --- a/_locales/el/messages.json +++ b/_locales/el/messages.json @@ -722,7 +722,7 @@ "markWatchedVideos": { "message": "Επισήμανση βίντεο που προβλήθηκαν" }, - "Max. width within the page": { + "maxWidthWithinThePage": { "message": "Μέγ. πλάτος εντός της σελίδας" }, "medium": { diff --git a/js&css/extension/www.youtube.com/general/general.css b/js&css/extension/www.youtube.com/general/general.css index 983069aa1..3ce31a260 100644 --- a/js&css/extension/www.youtube.com/general/general.css +++ b/js&css/extension/www.youtube.com/general/general.css @@ -65,7 +65,7 @@ html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-video-ren html[it-pathname='/feed/trending'][it-remove-trending-shorts="true"] ytd-rich-section-renderer:has(ytd-rich-grid-slim-media[is-short]), html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-rich-section-renderer:has(ytd-rich-grid-slim-media[is-short]), -html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer span#title:contains("Shorts"), +//html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer span#title:contains("Shorts"), html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer path[d^="M17.77,10.32l-1.2-.5L18,9.06a3.74,3.74"], html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer span#title:contains('Trending Shorts'), html[it-pathname='/feed/history'][it-remove-history-shorts="true"] ytd-reel-shelf-renderer yt-horizontal-list-renderer, diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index aa9ba3135..6ed11a2a2 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -2,21 +2,21 @@ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ ImprovedTube.autoplayDisable = function () { - var video = ImprovedTube.elements.player; - if (ImprovedTube.video_url !== location.href) { - this.user_interacted = false; - } - // if (allow autoplay is false) and (no ads playing) and + var video = ImprovedTube.elements.player; + if (ImprovedTube.video_url !== location.href) { + this.user_interacted = false; + } + // if (allow autoplay is false) and (no ads playing) and // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and it is not in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) - if (!this.user_interacted && video.classList.contains('ad-showing') === false && - ( + if (!this.user_interacted && video.classList.contains('ad-showing') === false && + ( // quick fix #1703 thanks to @AirRaid#9957 - (/* document.documentElement.dataset.pageType === "video" */ location.href.indexOf('/watch?') !== -1 && ((location.href.indexOf('list=') === -1 && ImprovedTube.storage.player_autoplay_disable) || (ImprovedTube.storage.playlist_autoplay === false && location.href.indexOf('list=') !== -1))) || - (/* document.documentElement.dataset.pageType === "channel" */ ImprovedTube.regex.channel.test(location.href) && ImprovedTube.storage.channel_trailer_autoplay === false) - ) - ) + (/* document.documentElement.dataset.pageType === "video" */ location.href.indexOf('/watch?') !== -1 && ((location.href.indexOf('list=') === -1 && ImprovedTube.storage.player_autoplay_disable) || (ImprovedTube.storage.playlist_autoplay === false && location.href.indexOf('list=') !== -1))) || + (/* document.documentElement.dataset.pageType === "channel" */ ImprovedTube.regex.channel.test(location.href) && ImprovedTube.storage.channel_trailer_autoplay === false) + ) + ) {if (!ImprovedTube.autoplayDeniedOnce) { - setTimeout(function () { video.pauseVideo(); }); + setTimeout(function () { video.pauseVideo(); }); ImprovedTube.autoplayDeniedOnce = true; } else { console.log("autoplay:off - should we pause here again?"); } } }; @@ -74,7 +74,7 @@ ImprovedTube.playerPlaybackSpeed = function () { if (this.storage.player_forced_ if ( !player.getVideoData().isLive || player.getVideoData().isLive === false) { player.setPlaybackRate(Number(option)); video.playbackRate = Number(option); // #1729 q2 // hi! @raszpl if ( (this.storage.player_force_speed_on_music !== true || this.storage.player_dont_speed_education === true) - && option !== 1) { + && option !== 1) { ImprovedTube.speedException = function () { if (this.storage.player_dont_speed_education === true && DATA.genre === 'Education') {player.setPlaybackRate(Number(1)); video.playbackRate = Number(1); return;} @@ -93,7 +93,7 @@ var musicRegexMatch = musicIdentifiersTitle.test(DATA.title); keywordsAmount = 1 + ((keywords || '').match(/,/) || []).length; if ( ((keywords || '').match(musicIdentifiersTags) || []).length / keywordsAmount > 0.08) { musicRegexMatch = true}} -notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(DATA.title + " " + keywords); +notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(DATA.title + " " + keywords); // (Tags/keywords shouldnt lie & very few songs titles might have these words) if (DATA.duration) { function parseDuration(duration) { const [_, h = 0, m = 0, s = 0] = duration.match(/PT(?:(\d+)?H)?(?:(\d+)?M)?(\d+)?S?/).map(part => parseInt(part) || 0); @@ -121,13 +121,13 @@ console.log("genre: " + DATA.genre + "//title: " + DATA.title + "//keywords: " // || location.href.indexOf('music.') !== -1 // (=currently we are only running on www.youtube.com anyways) ) { player.setPlaybackRate(1); video.playbackRate = 1; console.log ("...,thus must be music?"); } else { // Now this video might rarely be music - // - however we can make extra-sure after waiting for the video descripion to load... (#1539) + // - however we can make extra-sure after waiting for the video descripion to load... (#1539) var tries = 0; var intervalMs = 210; if (location.href.indexOf('/watch?') !== -1) {var maxTries = 10;} else {var maxTries = 0;} // ...except when it is an embedded player? var waitForDescription = setInterval(() => { if (++tries >= maxTries) { subtitle = document.querySelector('#title + #subtitle:last-of-type') - if ( subtitle && 1 <= Number((subtitle?.innerHTML?.match(/^\d+/) || [])[0]) // indicates buyable/registered music (amount of songs) + if ( subtitle && 1 <= Number((subtitle?.innerHTML?.match(/^\d+/) || [])[0]) // indicates buyable/registered music (amount of songs) && typeof testSongDuration(DATA.lengthSeconds, Number((subtitle?.innerHTML?.match(/^\d+/) || [])[0]) ) !== 'undefined' ) // resonable duration {player.setPlaybackRate(1); video.playbackRate = 1; console.log("...but YouTube shows music below the description!"); clearInterval(waitForDescription); } intervalMs *= 1.11; }}, intervalMs); @@ -143,12 +143,12 @@ DATA.videoID = ImprovedTube.videoId() || false; // if (history.length > 1 && history.state.endpoint.watchEndpoint) { try { DATA = JSON.parse(document.querySelector('#microformat script')?.textContent) ?? false; DATA.title = DATA.name;} catch { DATA.genre = false; DATA.keywords = false; DATA.lengthSeconds = false; - try { - DATA.title = document.getElementsByTagName('meta')?.title?.content || false; - DATA.genre = document.querySelector('meta[itemprop=genre]')?.content || false; - DATA.duration = document.querySelector('meta[itemprop=duration]')?.content || false; + try { + DATA.title = document.getElementsByTagName('meta')?.title?.content || false; + DATA.genre = document.querySelector('meta[itemprop=genre]')?.content || false; + DATA.duration = document.querySelector('meta[itemprop=duration]')?.content || false; } catch {}} if ( DATA.title === ImprovedTube.videoTitle() ) - { keywords = document.getElementsByTagName('meta')?.keywords?.content || false; if(!keywords){keyword=''} ImprovedTube.speedException(); } + { keywords = document.getElementsByTagName('meta')?.keywords?.content || false; if(!keywords){keyword=''} ImprovedTube.speedException(); } else { keywords = ''; (async function () { try { const response = await fetch(`https://www.youtube.com/watch?v=${DATA.videoID}`); const htmlContent = await response.text(); @@ -169,22 +169,22 @@ else { const invidiousInstances = ['iv.datura.network', 'vid.puffyan.us', 'invidious.perennialte.ch', 'iv.melmac.space', 'inv.in.projectsegfau.lt', 'invidious.asir.dev', 'inv.zzls.xyz', 'invidious.io.lol', 'onion.tube', 'yewtu.be', 'invidious.protokolla.fi', 'inv.citw.lgbt', 'anontube.lvkaszus.pl', 'iv.nboeck.de', 'invidious.no-logs.com', 'vid.priv.au', 'yt.cdaut.de', 'invidious.slipfox.xyz', 'yt.artemislena.eu', 'invidious.drgns.space', 'invidious.einfachzocken.eu', 'invidious.projectsegfau.lt', 'invidious.nerdvpn.de', 'invidious.private.coffee', 'invidious.lunar.icu', 'invidious.privacydev.net', 'invidious.fdn.fr', 'yt.oelrichsgarcia.de', 'iv.ggtyler.dev', 'inv.tux.pizza', 'yt.drgnz.club', 'inv.us.projectsegfau.lt']; function getRandomInvidiousInstance() { return invidiousInstances[Math.floor(Math.random() * invidiousInstances.length)];} -(async function () { let retries = 5; let invidiousFetched = false; - async function fetchInvidiousData() { - try {const response = await fetch(`https://${getRandomInvidiousInstance()}/api/v1/videos/${DATA.videoID}?fields=genre,title,lengthSeconds,keywords`); - DATA = await response.json(); - if (DATA.genre && DATA.title && DATA.keywords && DATA.lengthSeconds) { if (DATA.keywords.toString() === defaultKeywords ) {DATA.keywords = ''} - ImprovedTube.speedException(); invidiousFetched = true; } - } catch (error) { console.error('Error: Invidious API: ', error); } - } - while (retries > 0 && !invidiousFetched) { await fetchInvidiousData(); - if (!invidiousFetched) { await new Promise(resolve => setTimeout(resolve, retries === 5 ? 1234 : 432)); retries--; } } +(async function () { let retries = 5; let invidiousFetched = false; + async function fetchInvidiousData() { + try {const response = await fetch(`https://${getRandomInvidiousInstance()}/api/v1/videos/${DATA.videoID}?fields=genre,title,lengthSeconds,keywords`); + DATA = await response.json(); + if (DATA.genre && DATA.title && DATA.keywords && DATA.lengthSeconds) { if (DATA.keywords.toString() === defaultKeywords ) {DATA.keywords = ''} + ImprovedTube.speedException(); invidiousFetched = true; } + } catch (error) { console.error('Error: Invidious API: ', error); } + } + while (retries > 0 && !invidiousFetched) { await fetchInvidiousData(); + if (!invidiousFetched) { await new Promise(resolve => setTimeout(resolve, retries === 5 ? 1234 : 432)); retries--; } } if(!invidiousFetched){ if (document.readyState === 'loading') {document.addEventListener('DOMContentLoaded', ImprovedTube.fetchDOMData())} else { ImprovedTube.fetchDOMData();} } })(); } - } // else { } - } + } // else { } + } } } /*------------------------------------------------------------------------------ @@ -203,28 +203,28 @@ ImprovedTube.subtitles = function () { SUBTITLES LANGUAGE ------------------------------------------------------------------------------*/ ImprovedTube.subtitlesLanguage = function () { - var option = this.storage.subtitles_language; - if (this.isset(option) && option !== 'default') { - var player = this.elements.player, - button = this.elements.player_subtitles_button; - - if (player && player.getOption && button && button.getAttribute('aria-pressed') === 'true') { - var tracklist = this.elements.player.getOption('captions', 'tracklist', { - includeAsr: true - }); - - var matchTrack = false; - for (var i =0, l = tracklist.length; i resolution[label.indexOf(q)]); - quality = closest(resolution[label.indexOf(quality)], availableresolutions); - quality = label[resolution.indexOf(quality)]; - } - player.setPlaybackQualityRange(quality); - player.setPlaybackQuality(quality); - player.dataset.defaultQuality = quality; - } - } + }; + + var player = this.elements.player, + quality = this.storage.player_quality; + + if (player && player.getAvailableQualityLevels && !player.dataset.defaultQuality) { + var available_quality_levels = player.getAvailableQualityLevels(); + + if (quality && quality !== 'auto') { + if (available_quality_levels.includes(quality) === false) { + let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; + let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; + let availableresolutions = available_quality_levels.reduce(function (array, elem) { + array.push(resolution[label.indexOf(elem)]); return array; + }, []); + + quality = closest (resolution[label.indexOf(quality)], availableresolutions); + quality = label[resolution.indexOf(quality)]; + } + + player.setPlaybackQualityRange(quality); + player.setPlaybackQuality(quality); + player.dataset.defaultQuality = quality; + } + } }; /*------------------------------------------------------------------------------ QUALITY WITHOUT FOCUS ------------------------------------------------------------------------------*/ ImprovedTube.playerQualityWithoutFocus = function () { - var qualityWithoutFocus = this.storage.player_quality_without_focus; - if (qualityWithoutFocus && qualityWithoutFocus !== 'disabled') { - if (this.focus === true) { - if (ImprovedTube.qualityBeforeBlur) { - ImprovedTube.playerQuality(ImprovedTube.qualityBeforeBlur); - } else { - ImprovedTube.playerQuality(); - } - } else if (this.focus === false) { - ImprovedTube.qualityBeforeBlur = this.elements.player.getPlaybackQuality(); - if (ImprovedTube.played_time > 0 && ImprovedTube.formatSecond(player.getDuration() * 0.997 - player.getCurrentTime()) > 11) { - setTimeout(function () { - if (this.focus === false) { - ImprovedTube.playerQuality(qualityWithoutFocus); - } - }, Math.max(321, 3210 - ImprovedTube.played_time)); - } - } - } + function closest (num, arr) { + let curr = arr[0]; + let diff = Math.abs (num - curr); + for (let val = 0; val < arr.length; val++) { + let newdiff = Math.abs (num - arr[val]); + if (newdiff < diff) { + diff = newdiff; + curr = arr[val]; + } + } + return curr; + }; + var player = this.elements.player, + qualityWithoutFocus = this.storage.player_quality_without_focus; + quality = this.storage.player_quality; + if(qualityWithoutFocus && qualityWithoutFocus != 'disabled' && player){ + if(this.focus === false) { + var available_quality_levels = player.getAvailableQualityLevels(); + if (available_quality_levels.includes(qualityWithoutFocus) === false) { + let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; + let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; + let availableresolutions = available_quality_levels.reduce(function (array, elem) { + array.push(resolution[label.indexOf(elem)]); return array; + }, []); + + qualityWithoutFocus = closest (resolution[label.indexOf(qualityWithoutFocus)], availableresolutions); + qualityWithoutFocus = label[resolution.indexOf(qualityWithoutFocus)]; + } + + player.setPlaybackQualityRange(qualityWithoutFocus); + player.setPlaybackQuality(qualityWithoutFocus); + + } + if (this.focus === true){ + var available_quality_levels = player.getAvailableQualityLevels(); + if (available_quality_levels.includes(quality) === false) { + let label = ['tiny', 'small', 'medium', 'large', 'hd720', 'hd1080', 'hd1440', 'hd2160', 'hd2880', 'highres']; + let resolution = ['144', '240', '360', '480', '720', '1080', '1440', '2160', '2880', '4320']; + let availableresolutions = available_quality_levels.reduce(function (array, elem) { + array.push(resolution[label.indexOf(elem)]); return array; + }, []); + + quality = closest (resolution[label.indexOf(quality)], availableresolutions); + quality = label[resolution.indexOf(quality)]; + } + + player.setPlaybackQualityRange(quality); + player.setPlaybackQuality(quality); + } + } + }; /*------------------------------------------------------------------------------ FORCED VOLUME ------------------------------------------------------------------------------*/ ImprovedTube.playerVolume = function () { - if (this.storage.player_forced_volume === true) { - var volume = this.storage.player_volume; + if (this.storage.player_forced_volume === true) { + var volume = this.storage.player_volume; - if (!this.isset(volume)) { - volume = 100; - } else { - volume = Number(volume); - } + if (!this.isset(volume)) { + volume = 100; + } else { + volume = Number(volume); + } - if (!this.audioContextGain && volume <= 100) { - if (this.audioContext) { - this.audioContext.close(); - } + if (!this.audioContextGain && volume <= 100) { + if (this.audioContext) { + this.audioContext.close(); + } - this.elements.player.setVolume(volume); - } else { - if (!this.audioContext) { - this.audioContext = new AudioContext(); + this.elements.player.setVolume(volume); + } else { + if (!this.audioContext) { + this.audioContext = new AudioContext(); - this.audioContextSource = this.audioContext.createMediaElementSource(document.querySelector('video')); - this.audioContextGain = this.audioContext.createGain(); + this.audioContextSource = this.audioContext.createMediaElementSource(document.querySelector('video')); + this.audioContextGain = this.audioContext.createGain(); - this.audioContextGain.gain.value = 1; - this.audioContextSource.connect(this.audioContextGain); - this.audioContextGain.connect(this.audioContext.destination) - } + this.audioContextGain.gain.value = 1; + this.audioContextSource.connect(this.audioContextGain); + this.audioContextGain.connect(this.audioContext.destination) + } if (this.elements.player.getVolume() !== 100) { this.elements.player.setVolume(100);} - this.audioContextGain.gain.value = volume / 100; - } - } + this.audioContextGain.gain.value = volume / 100; + } + } }; /*------------------------------------------------------------------------------ LOUDNESS NORMALIZATION @@ -651,7 +690,7 @@ ImprovedTube.screenshot = function () { a.href = URL.createObjectURL(blob); console.log("screeeeeeenshot tada!"); - a.download = (ImprovedTube.videoId() || location.href.match) + ' ' + new Date(ImprovedTube.elements.player.getCurrentTime() * 1000).toISOString().substr(11, 8).replace(/:/g, '-') + ' ' + ImprovedTube.videoTitle() + (subText ? ' - ' + subText.trim() : '') + '.png'; + a.download = (ImprovedTube.videoId() || location.href.match) + ' ' + new Date(ImprovedTube.elements.player.getCurrentTime() * 1000).toISOString().substr(11, 8).replace(/:/g, '-') + ' ' + ImprovedTube.videoTitle() + (subText ? ' - ' + subText.trim() : '') + '.png'; a.click(); } else { @@ -668,28 +707,28 @@ ImprovedTube.screenshot = function () { }; ImprovedTube.renderSubtitle = function (ctx,captionElements) { - if (ctx && captionElements) { - captionElements.forEach(function (captionElement, index) { - var captionText = captionElement.textContent.trim(); - var captionStyles = window.getComputedStyle(captionElement); - - ctx.fillStyle = captionStyles.color; - ctx.font = captionStyles.font; - ctx.textAlign = 'center'; - ctx.textBaseline = 'bottom'; - var txtWidth = ctx.measureText(captionText).width; - var txtHeight = parseFloat(captionStyles.fontSize); - - var xOfset = (ctx.canvas.width - txtWidth) / 2; - - var padding = 5; // Adjust the padding as needed - var yofset = ctx.canvas.height - (captionElements.length - index) * (txtHeight + 2 * padding); - - ctx.fillStyle = captionStyles.backgroundColor; - ctx.fillRect(xOfset - padding, yofset - txtHeight - padding, txtWidth + 2 * padding, txtHeight + 2 * padding); - ctx.fillStyle = captionStyles.color; - ctx.fillText(captionText, xOfset + txtWidth / 2, yofset); - }); + if (ctx && captionElements) { + captionElements.forEach(function (captionElement, index) { + var captionText = captionElement.textContent.trim(); + var captionStyles = window.getComputedStyle(captionElement); + + ctx.fillStyle = captionStyles.color; + ctx.font = captionStyles.font; + ctx.textAlign = 'center'; + ctx.textBaseline = 'bottom'; + var txtWidth = ctx.measureText(captionText).width; + var txtHeight = parseFloat(captionStyles.fontSize); + + var xOfset = (ctx.canvas.width - txtWidth) / 2; + + var padding = 5; // Adjust the padding as needed + var yofset = ctx.canvas.height - (captionElements.length - index) * (txtHeight + 2 * padding); + + ctx.fillStyle = captionStyles.backgroundColor; + ctx.fillRect(xOfset - padding, yofset - txtHeight - padding, txtWidth + 2 * padding, txtHeight + 2 * padding); + ctx.fillStyle = captionStyles.color; + ctx.fillText(captionText, xOfset + txtWidth / 2, yofset); + }); } }; @@ -715,13 +754,13 @@ ImprovedTube.playerScreenshotButton = function () { /*------------------------------------------------------------------------------ REPEAT -------------------------------------------------------------------------------*/ -ImprovedTube.playerRepeat = function () { +ImprovedTube.playerRepeat = function () { setTimeout(function () { if (!/ad-showing/.test(ImprovedTube.elements.player.className)) { ImprovedTube.elements.video.setAttribute('loop', ''); } //ImprovedTube.elements.buttons['it-repeat-styles'].style.opacity = '1'; //old class from version 3.x? that both repeat buttons could have - }, 200); + }, 200); } /*------------------------------------------------------------------------------ REPEAT BUTTON @@ -733,7 +772,7 @@ ImprovedTube.playerRepeatButton = function (node) { svg.setAttributeNS(null, 'viewBox', '0 0 24 24'); path.setAttributeNS(null, 'd', 'M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4zm-4-2V9h-1l-2 1v1h1.5v4H13z'); svg.appendChild(path); - var transparentOrOn = 0.5; if (this.storage.player_always_repeat === true ) { transparentOrOn = 1; } + var transparentOrOn = 0.5; if (this.storage.player_always_repeat === true ) { transparentOrOn = 1; } this.createPlayerButton({ id: 'it-repeat-button', child: svg, @@ -742,7 +781,7 @@ ImprovedTube.playerRepeatButton = function (node) { var video = ImprovedTube.elements.video; function matchLoopState(opacity) { var thisButton = document.querySelector('#it-repeat-button'); - thisButton.style.opacity = opacity; + thisButton.style.opacity = opacity; if (ImprovedTube.storage.below_player_loop !== false) { var otherButton = document.querySelector('#it-below-player-loop'); otherButton.children[0].style.opacity = opacity; @@ -818,10 +857,10 @@ FIT-TO-WIN BUTTON ------------------------------------------------------------------------------*/ ImprovedTube.playerFitToWinButton = function () { if (this.storage.player_fit_to_win_button === true && (/watch\?/.test(location.href))) { - let tempContainer = document.createElement("div"); - tempContainer.innerHTML = ` + let tempContainer = document.createElement("div"); + tempContainer.innerHTML = ` `; - const svg = tempContainer.firstChild; + const svg = tempContainer.firstChild; this.createPlayerButton({ id: 'it-fit-to-win-player-button', child: svg, @@ -954,17 +993,17 @@ ImprovedTube.playerCinemaModeEnable = function () { HAMBURGER MENU ------------------------------------------------------------------------------*/ ImprovedTube.playerHamburgerButton = function () { if(this.storage.player_hamburger_button === true){ - const videoPlayer = document.querySelector('.html5-video-player'); + const videoPlayer = document.querySelector('.html5-video-player'); - if (!videoPlayer) { - return; - } + if (!videoPlayer) { + return; + } - const controlsContainer = videoPlayer.querySelector('.ytp-right-controls'); + const controlsContainer = videoPlayer.querySelector('.ytp-right-controls'); - if (!controlsContainer) { - return; - } + if (!controlsContainer) { + return; + } let hamburgerMenu = document.querySelector('.custom-hamburger-menu'); if (!hamburgerMenu) { @@ -1068,20 +1107,20 @@ ImprovedTube.playerSDR = function () { Hide controls ------------------------------------------------------------------------------*/ ImprovedTube.playerControls = function (pause=false) { - var player = this.elements.player; if (player) { + var player = this.elements.player; if (player) { let hide = this.storage.player_hide_controls; - if (hide === 'always') { - player.hideControls(); - } else if(hide === 'off') { - player.showControls(); - } else if(hide === 'when_paused') { + if (hide === 'always') { + player.hideControls(); + } else if(hide === 'off') { + player.showControls(); + } else if(hide === 'when_paused') { if(this.elements.video.paused){ - player.hideControls( ); + player.hideControls( ); ImprovedTube.elements.player.parentNode.addEventListener('mouseenter', function () { player.showControls();}); ImprovedTube.elements.player.parentNode.addEventListener('mouseleave', function () { - player.hideControls( );}); + player.hideControls( );}); ImprovedTube.elements.player.parentNode.onmousemove = (function() { @@ -1098,7 +1137,7 @@ ImprovedTube.playerControls = function (pause=false) { }} else { player.showControls(); } } }; -/*# HIDE VIDEO TITLE IN FULLSCREEN */ // Easier with CSS only (see player.css) +/*# HIDE VIDEO TITLE IN FULLSCREEN */ // Easier with CSS only (see player.css) //ImprovedTube.hideVideoTitleFullScreen = function (){ if (ImprovedTube.storage.hide_video_title_fullScreen === true) { //document.addEventListener('fullscreenchange', function (){ document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'none'); }) }}; @@ -1106,18 +1145,18 @@ ImprovedTube.playerControls = function (pause=false) { CUSTOM MINI-PLAYER ------------------------------------------------------------------------------*/ ImprovedTube.mini_player__setSize = function (width, height, keep_ar, keep_area) { - if (keep_ar) { - const aspect_ratio = ImprovedTube.elements.video.style.width.replace('px', '') / ImprovedTube.elements.video.style.height.replace('px', ''); - if (keep_area) { - height = Math.sqrt((width * height) / aspect_ratio); - width = height * aspect_ratio; - } else { - height = width / aspect_ratio; - } - } + if (keep_ar) { + const aspect_ratio = ImprovedTube.elements.video.style.width.replace('px', '') / ImprovedTube.elements.video.style.height.replace('px', ''); + if (keep_area) { + height = Math.sqrt((width * height) / aspect_ratio); + width = height * aspect_ratio; + } else { + height = width / aspect_ratio; + } + } - ImprovedTube.elements.player.style.width = width + 'px'; - ImprovedTube.elements.player.style.height = height + 'px'; + ImprovedTube.elements.player.style.width = width + 'px'; + ImprovedTube.elements.player.style.height = height + 'px'; }; ImprovedTube.miniPlayer_scroll = function () { diff --git a/menu/skeleton-parts/search.js b/menu/skeleton-parts/search.js index 03ecd0d0c..e89e7b0a5 100644 --- a/menu/skeleton-parts/search.js +++ b/menu/skeleton-parts/search.js @@ -33,8 +33,8 @@ extension.skeleton.header.sectionEnd.search.on.click = { input: function (event) { let self = this, value = this.value.trim(); - - extension.search = value; + + if (value) extension.search = value; if (value.length > 0) { satus.search(value, extension.skeleton, function (results) { From f1ab739c923eb7bd1b651a951b0eb29b213962c0 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sun, 28 Apr 2024 20:21:13 +0200 Subject: [PATCH 74/94] #2218 --- js&css/web-accessible/www.youtube.com/player.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index b8328b770..5bd20f2e3 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -495,8 +495,7 @@ ImprovedTube.playerAutofullscreen = function () { QUALITY ------------------------------------------------------------------------------*/ ImprovedTube.playerQuality = function (quality = this.storage.player_quality) { - let player = this.elements.player; - if (quality && player && player.getAvailableQualityLevels + if (quality && (let player = this.elements.player) && player.getAvailableQualityLevels && (!player.dataset.defaultQuality || player.dataset.defaultQuality != quality)) { let available_quality_levels = player.getAvailableQualityLevels(); function closest(num, arr) { @@ -527,17 +526,16 @@ ImprovedTube.playerQuality = function (quality = this.storage.player_quality) { QUALITY WITHOUT FOCUS ------------------------------------------------------------------------------*/ ImprovedTube.playerQualityWithoutFocus = function () { - let player = this.elements.player, qualityWithoutFocus = this.storage.player_quality_without_focus; - if (qualityWithoutFocus && qualityWithoutFocus !== 'auto' && player && player.getPlaybackQuality) { + if (qualityWithoutFocus && qualityWithoutFocus !== 'auto' ) { if (this.focus) { if (ImprovedTube.qualityBeforeBlur) { ImprovedTube.playerQuality(ImprovedTube.qualityBeforeBlur); - } + } } else { - if (!ImprovedTube.elements.video.paused) { - ImprovedTube.qualityBeforeBlur = player.getPlaybackQuality(); - ImprovedTube.playerQuality(qualityWithoutFocus); + if ((let player = this.elements.player) && player.getPlaybackQuality && !ImprovedTube.elements.video.paused) { + ImprovedTube.qualityBeforeBlur = player.getPlaybackQuality(); + ImprovedTube.playerQuality(qualityWithoutFocus); } } } From 8ec11736383fb3d38675626e32392b3f7bb50bfa Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Mon, 29 Apr 2024 07:12:21 +0200 Subject: [PATCH 75/94] Update player.js unmangle --- js&css/web-accessible/www.youtube.com/player.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 5bd20f2e3..b8328b770 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -495,7 +495,8 @@ ImprovedTube.playerAutofullscreen = function () { QUALITY ------------------------------------------------------------------------------*/ ImprovedTube.playerQuality = function (quality = this.storage.player_quality) { - if (quality && (let player = this.elements.player) && player.getAvailableQualityLevels + let player = this.elements.player; + if (quality && player && player.getAvailableQualityLevels && (!player.dataset.defaultQuality || player.dataset.defaultQuality != quality)) { let available_quality_levels = player.getAvailableQualityLevels(); function closest(num, arr) { @@ -526,16 +527,17 @@ ImprovedTube.playerQuality = function (quality = this.storage.player_quality) { QUALITY WITHOUT FOCUS ------------------------------------------------------------------------------*/ ImprovedTube.playerQualityWithoutFocus = function () { + let player = this.elements.player, qualityWithoutFocus = this.storage.player_quality_without_focus; - if (qualityWithoutFocus && qualityWithoutFocus !== 'auto' ) { + if (qualityWithoutFocus && qualityWithoutFocus !== 'auto' && player && player.getPlaybackQuality) { if (this.focus) { if (ImprovedTube.qualityBeforeBlur) { ImprovedTube.playerQuality(ImprovedTube.qualityBeforeBlur); - } + } } else { - if ((let player = this.elements.player) && player.getPlaybackQuality && !ImprovedTube.elements.video.paused) { - ImprovedTube.qualityBeforeBlur = player.getPlaybackQuality(); - ImprovedTube.playerQuality(qualityWithoutFocus); + if (!ImprovedTube.elements.video.paused) { + ImprovedTube.qualityBeforeBlur = player.getPlaybackQuality(); + ImprovedTube.playerQuality(qualityWithoutFocus); } } } From 29db2fa4bdc87171f4eba15ca43b14108f755656 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Tue, 30 Apr 2024 14:02:37 +0200 Subject: [PATCH 76/94] Update README.md --- .github/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index 6e79e4a9e..1c32539f4 100644 --- a/.github/README.md +++ b/.github/README.md @@ -195,7 +195,7 @@ Chinese + Hindi + Spanish.
(Compare: Wikipedia Bots. Would especially help medium-size projects.)
(+[community-list of regEx](https://github.com/code4charity/the-RegEx-Collector--Queries--Patterns " - ")?) ##### 💡 Vision for the _(tweaking-/userStyle-/"modding-"_)Community: -We can optimize things for the world, greatly prioritized: [UUT](https://github.com/code-charity/Universal-UserTweaks)
( "insteada just tweakin@home like Sisyphos" ) +We can optimize things for the world, greatly prioritized: [Crowd Fixes](https://github.com/code-charity/Universal-UserTweaks)
( "insteada just tweakin@home like Sisyphos" )
##### 💡 Got great ideas? From b13c773b5656bc4ca78bc05ccc0348800fca61ea Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Tue, 30 Apr 2024 14:20:41 +0200 Subject: [PATCH 77/94] Update themes.js 'ytd-masthead') no guaranteed to exists, fixes random extension crash on load --- js&css/web-accessible/www.youtube.com/themes.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/themes.js b/js&css/web-accessible/www.youtube.com/themes.js index 5edcd49d3..b47884788 100644 --- a/js&css/web-accessible/www.youtube.com/themes.js +++ b/js&css/web-accessible/www.youtube.com/themes.js @@ -75,7 +75,9 @@ ImprovedTube.myColors = function () { document.getElementById("cinematics").style.visibility = 'hidden'; document.getElementById("cinematics").style.display = 'none !important'; } - document.querySelector('ytd-masthead').style.backgroundColor = ''+primary_color+''; + if (document.querySelector('ytd-masthead')) { + document.querySelector('ytd-masthead').style.backgroundColor = ''+primary_color+''; + } } else { //theoretically this will never be called this.elements.my_colors?.remove(); } @@ -94,7 +96,9 @@ let darkCookie; document.getElementById('cinematics').style.display = 'none !important'; } this.elements.my_colors?.remove(); - document.querySelector('ytd-masthead').style.backgroundColor ='#000'; + if (document.querySelector('ytd-masthead')) { + document.querySelector('ytd-masthead').style.backgroundColor ='#000'; + } break case 'default': From b84ef7aeef8d4f5de3dc0d6dff46be05ee97e755 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Wed, 1 May 2024 19:32:11 +0200 Subject: [PATCH 78/94] Update active-features.js search returns buttons now, skip those --- menu/skeleton-parts/active-features.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/menu/skeleton-parts/active-features.js b/menu/skeleton-parts/active-features.js index ab6dd3ed1..9fd71a2b8 100644 --- a/menu/skeleton-parts/active-features.js +++ b/menu/skeleton-parts/active-features.js @@ -15,9 +15,13 @@ extension.skeleton.header.sectionEnd.menu.on.click.activeFeatures = { satus.search('', extension.skeleton, function (features) { let skeleton = {}; - for (const key in features) { - let feature = features[key], - default_value = feature.value, + for (const [key, feature] of Object.entries(features)) { + // search returns buttons now, skip those + if (feature.component === 'button') { + continue; + } + + let default_value = feature.value, value = feature.storage && satus.storage.get(feature.storage) || feature.radio && satus.storage.get(feature.radio.group) == feature.radio.value || satus.storage.get(key), From 427b3ede9eb65a876cc9d75ae6bb92974acc064b Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Thu, 2 May 2024 14:07:08 +0200 Subject: [PATCH 79/94] https://github.com/code-charity/youtube/commit/0af358368c20898677ff23474574e71d0794df11 --- js&css/web-accessible/core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js&css/web-accessible/core.js b/js&css/web-accessible/core.js index 631d436a0..f48e49b04 100644 --- a/js&css/web-accessible/core.js +++ b/js&css/web-accessible/core.js @@ -244,12 +244,12 @@ document.addEventListener('it-message-from-extension', function () { } break - case 'commentsSidebar': - if (ImprovedTube.storage.comments_sidebar === false) { + case 'commentsSidebarSimple': + if (ImprovedTube.storage.comments_sidebar_simple === false) { document.querySelector("#below").appendChild(document.querySelector("#comments")); document.querySelector("#secondary").appendChild(document.querySelector("#related")); } else { - ImprovedTube.commentsSidebar(); + ImprovedTube.commentsSidebarSimple(); } break From 0601b9cf9c833df71a49eb5c914bdd53e8078f41 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 4 May 2024 19:33:40 +0200 Subject: [PATCH 80/94] Update player.js quick bodge fix for #2137 https://github.com/code-charity/youtube/issues/2137 do nothing if we fail to grab video element in time --- js&css/web-accessible/www.youtube.com/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index b8328b770..91a30c3fb 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -2,13 +2,13 @@ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ ImprovedTube.autoplayDisable = function () { - var video = ImprovedTube.elements.player; + const video = ImprovedTube.elements.player; if (ImprovedTube.video_url !== location.href) { this.user_interacted = false; } // if (allow autoplay is false) and (no ads playing) and // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and it is not in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) - if (!this.user_interacted && video.classList.contains('ad-showing') === false && + if (video && !this.user_interacted && video.classList.contains('ad-showing') === false && ( // quick fix #1703 thanks to @AirRaid#9957 (/* document.documentElement.dataset.pageType === "video" */ location.href.indexOf('/watch?') !== -1 && ((location.href.indexOf('list=') === -1 && ImprovedTube.storage.player_autoplay_disable) || (ImprovedTube.storage.playlist_autoplay === false && location.href.indexOf('list=') !== -1))) || From 6d8f8e0bfb47e6b05a2b52c57494be326ce3cc23 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 4 May 2024 19:37:06 +0200 Subject: [PATCH 81/94] Update functions.js bodge fix --- js&css/web-accessible/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index c84844ecc..dc81cf4c8 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -340,7 +340,7 @@ ImprovedTube.playerOnPlay = function () { this.removeEventListener('ended', ImprovedTube.playerOnEnded, true); this.addEventListener('ended', ImprovedTube.playerOnEnded, true); - ImprovedTube.autoplayDisable(); + ImprovedTube.autoplayDisable(this); ImprovedTube.playerLoudnessNormalization(); ImprovedTube.playerCinemaModeEnable(); From 54b65bd86ff75fc27e04475e44221215ba0d7a0c Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 4 May 2024 19:39:07 +0200 Subject: [PATCH 82/94] Update player.js slightly more robust bodge fix --- js&css/web-accessible/www.youtube.com/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 91a30c3fb..bf098707f 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -1,8 +1,8 @@ /*------------------------------------------------------------------------------ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ -ImprovedTube.autoplayDisable = function () { - const video = ImprovedTube.elements.player; +ImprovedTube.autoplayDisable = function (videoElement) { + const video = ImprovedTube.elements.player || videoElement.closest('#movie_player'); if (ImprovedTube.video_url !== location.href) { this.user_interacted = false; } From d727f82c03823f4cfccd2a2136ee9878dc782e48 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sat, 4 May 2024 23:43:24 +0200 Subject: [PATCH 83/94] Update styles.css syncing to master --- js&css/extension/www.youtube.com/styles.css | 247 ++++++++++++-------- 1 file changed, 148 insertions(+), 99 deletions(-) diff --git a/js&css/extension/www.youtube.com/styles.css b/js&css/extension/www.youtube.com/styles.css index dfad496be..b772dcb56 100644 --- a/js&css/extension/www.youtube.com/styles.css +++ b/js&css/extension/www.youtube.com/styles.css @@ -196,18 +196,18 @@ html[it-mini-player-cursor='nw-resize']::after { /*------------------------------------------------------------------------------ # ------------------------------------------------------------------------------*/ -html[data-page-type='video'][it-player-fit-to-win-button='true'] .ytp-right-controls { +html[it-player-fit-to-win-button=true][data-page-type=video] .ytp-right-controls { display: flex; } -html[data-page-type='video'][it-player-fit-to-win-button='true'] #it-fit-to-win-player-button { +html[it-player-fit-to-win-button=true][data-page-type=video] #it-fit-to-win-player-button { order: 1; } -html[data-page-type='video'][it-player-fit-to-win-button='true'] .ytp-fullscreen-button { +html[it-player-fit-to-win-button=true][data-page-type=video] .ytp-fullscreen-button { order: 2; } -html[data-page-type='video'][it-player-fit-to-win-button='true'] #ftw-icon path { +html[it-player-fit-to-win-button=true][data-page-type=video] #ftw-icon path { fill: none; } .it-player-button { @@ -585,9 +585,6 @@ ytd-rich-grid-media .it-blocklisted-channel { max-width: 220px; transition: max-width 0.4s ease 1.1s; } -/* .it-blocklisted-video #metadata-line {display:none !important} - .it-blocklisted-video div {display: inline-block !important} */ - /*------------NEW---------------*/ .improvedtube-sidebar-a { @@ -663,14 +660,21 @@ ytd-rich-grid-media .it-blocklisted-channel { ------------------------------------------------------------------------------*/ /*update: cinematics */ html[it-theme=black] #cinematics, -html[it-theme=desert] #cinematics {display:none !important} +html[it-theme=desert] #cinematics { + display:none !important +} html[it-theme=dawn] #cinematics, html[it-theme=sunset] #cinematics, -html[it-theme=night] #cinematics {mix-blend-mode: lighten !important} -html[it-theme=plain] #cinematics {filter:invert(100%) !important; mix-blend-mode: darken !important} +html[it-theme=night] #cinematics { + mix-blend-mode: lighten !important +} +html[it-theme=plain] #cinematics { + filter:invert(100%) !important; + mix-blend-mode: darken !important +} /*video detail text color. Fix. Themes didnt apply video description text color*/ -html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} +html[it-theme] .yt-core-attributed-string--link-inherit-color {color: var(--yt-spec-text-primary) !important} html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed-string__link--call-to-action-color {color: var(--yt-spec-call-to-action)} /*The next two lines below can be removed if exact theming consistency isn't the goal and we just want to keep it simple.*/ html[it-theme]:not([it-theme=default]):not([it-theme=dark]) a.yt-simple-endpoint.yt-formatted-string {color: var(--yt-spec-call-to-action) !important} @@ -680,9 +684,10 @@ html[it-theme]:not([it-theme=default]):not([it-theme=dark]) .yt-core-attributed- /*BLACK*/ +html[it-theme=black] [dark], html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #000 !important; --yt-swatch-primary-darker: #000 !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -703,8 +708,8 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc --yt-spec-general-background-b: #000 !important; --yt-spec-general-background-c: #000 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #aaa !important; - --yt-spec-text-primary-inverse: #003459 !important; + --yt-spec-text-primary: #aaa; + --yt-spec-text-primary-inverse: #000 !important; --yt-spec-text-secondary: #aaa !important; --yt-spec-text-disabled: #aaa !important; --yt-spec-call-to-action: #0073e6 !important; @@ -735,15 +740,15 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { -webkit-filter: grayscale(1) brightness(3.5); filter: grayscale(1) brightness(3.5); } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #000 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -756,8 +761,8 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #000; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -771,10 +776,11 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); + --ytd-searchbox-background: #000; --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); @@ -888,7 +894,6 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc --yt-main-app-background-tmp: #000; --yt-guide-background: #000; --yt-dialog-background: #000; - --yt-searchbox-background: #000 !important; --yt-channel-header-background: #000; --yt-sidebar-background: #000; --yt-transcript-background: #000; @@ -900,8 +905,8 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc } html[it-theme=black]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=black][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=black][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=black][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(18,24,24,1.000) !important; --yt-lightsource-section3-color: rgba(20,30,30,1.000) !important; --yt-lightsource-section4-color: rgba(24,38,38,1.000) !important; @@ -911,9 +916,10 @@ html[data-system-color-scheme=light][it-theme=black][it-schedule=system_peferenc /*DAWN*/ +html[it-theme=dawn] [dark], html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #d44d5c !important; --yt-swatch-primary-darker: #d44d5c !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -934,8 +940,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference --yt-spec-general-background-b: #d44d5c !important; --yt-spec-general-background-c: #d44d5c !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: rgb(255, 255, 255) !important; - --yt-spec-text-primary-inverse: #003459 !important; + --yt-spec-text-primary: rgb(255, 255, 255); + --yt-spec-text-primary-inverse: #734 !important; --yt-spec-text-secondary: rgb(255, 255, 255) !important; --yt-spec-text-disabled: rgb(255, 255, 255) !important; --yt-spec-call-to-action: #0073e6 !important; @@ -966,8 +972,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #835 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -983,8 +989,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #d44d5c; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -998,10 +1004,11 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); + --ytd-searchbox-background: #672c3b; --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); @@ -1115,7 +1122,6 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference --yt-main-app-background-tmp: #d44d5c; --yt-guide-background: #d44d5c; --yt-dialog-background: #734; - --yt-searchbox-background: #672c3b; --yt-channel-header-background: #d44d5c; --yt-sidebar-background: #d44d5c; --yt-transcript-background: #d44d5c; @@ -1128,15 +1134,15 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { -webkit-filter: grayscale(1) brightness(4); filter: grayscale(1) brightness(4); } html[it-theme=dawn]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=dawn][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=dawn][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=dawn][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.2) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.3) !important; @@ -1147,8 +1153,8 @@ html[data-system-color-scheme=light][it-theme=dawn][it-schedule=system_peference /*DESERT*/ html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light] { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #faf9f9 !important; --yt-swatch-primary-darker: #faf9f9 !important; --yt-swatch-text: #555 !important; @@ -1169,8 +1175,8 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen --yt-spec-general-background-b: #faf9f9 !important; --yt-spec-general-background-c: #faf9f9 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #555 !important; - --yt-spec-text-primary-inverse: #003459 !important; + --yt-spec-text-primary: #555; + --yt-spec-text-primary-inverse: #faf9f9 !important; --yt-spec-text-secondary: #555 !important; --yt-spec-text-disabled: #555 !important; --yt-spec-call-to-action: #0073e6 !important; @@ -1201,8 +1207,8 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen } html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #ced3cb !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1218,8 +1224,8 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen } html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #faf9f9; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: #555; @@ -1233,18 +1239,19 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=desert]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=desert][it-schedule=system_peference_dark]:not(.style-scope)[dark], -html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peference_light]:not(.style-scope)[dark] { +html[it-theme=desert][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not(.style-scope)[dark], +html[it-theme=desert][data-system-color-scheme=light][it-schedule=system_peference_light]:not(.style-scope)[dark] { --yt-spec-icon-inactive: #555; --yt-spec-text-primary: #555; --ytd-searchbox-border-color: #555; - --ytd-searchbox-legacy-border-color: #555; - --ytd-searchbox-legacy-border-shadow-color: #555; - --ytd-searchbox-legacy-button-color: #555; - --ytd-searchbox-legacy-button-border-color: #555; - --ytd-searchbox-legacy-button-focus-color: #555; - --ytd-searchbox-legacy-button-hover-color: #555; - --ytd-searchbox-legacy-button-hover-border-color: #555; + --ytd-searchbox-background: #faf9f9; + --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); + --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); + --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); + --ytd-searchbox-legacy-button-border-color: hsl(0, 0%, 18.82%); + --ytd-searchbox-legacy-button-focus-color: hsla(0, 0%, 100%, .08); + --ytd-searchbox-legacy-button-hover-color: hsla(0, 0%, 100%, .08); + --ytd-searchbox-legacy-button-hover-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-button-icon-color: #fff; --ytd-moderation-panel-background: #555; --ytd-moderation-panel-hover: #555; @@ -1351,7 +1358,6 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen --yt-main-app-background-tmp: #faf9f9; --yt-guide-background: #faf9f9; --yt-dialog-background: #bee3db; - --yt-searchbox-background: #faf9f9; --yt-channel-header-background: #faf9f9; --yt-sidebar-background: #faf9f9; --yt-transcript-background: #faf9f9; @@ -1365,9 +1371,10 @@ html[data-system-color-scheme=light][it-theme=desert][it-schedule=system_peferen /*NIGHT*/ +html[it-theme=night] [dark], html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #003459 !important; --yt-swatch-primary-darker: #003459 !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -1388,7 +1395,7 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc --yt-spec-general-background-b: #003459 !important; --yt-spec-general-background-c: #003459 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #fff !important; + --yt-spec-text-primary: #fff; --yt-spec-text-primary-inverse: #003459 !important; --yt-spec-text-secondary: #fff !important; --yt-spec-text-disabled: #fff !important; @@ -1420,15 +1427,15 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark] #yt-masthead-logo-fragment .masthead-logo-renderer-logo, +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] #yt-masthead-logo-fragment .masthead-logo-renderer-logo { -webkit-filter: grayscale(1) brightness(3.5); filter: grayscale(1) brightness(3.5); } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #007ea7 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1444,8 +1451,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #003459; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -1459,10 +1466,11 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); + --ytd-searchbox-background: #003459; --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); @@ -1576,7 +1584,6 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc --yt-main-app-background-tmp: #003459; --yt-guide-background: #003459; --yt-dialog-background: #007ea7; - --yt-searchbox-background: #003459 !important; --yt-channel-header-background: #003459; --yt-sidebar-background: #003459; --yt-transcript-background: #003459; @@ -1588,8 +1595,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc } html[it-theme=night]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=night][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=night][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=night][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.2) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.3) !important; @@ -1600,8 +1607,8 @@ html[data-system-color-scheme=light][it-theme=night][it-schedule=system_peferenc /*PLAIN*/ html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light] { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #c7efcf !important; --yt-swatch-primary-darker: #c7efcf !important; --yt-swatch-text: #666 !important; @@ -1622,8 +1629,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc --yt-spec-general-background-b: #c7efcf !important; --yt-spec-general-background-c: #c7efcf !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #666 !important; - --yt-spec-text-primary-inverse: #003459 !important; + --yt-spec-text-primary: #666; + --yt-spec-text-primary-inverse: #d3e1c6 !important; --yt-spec-text-secondary: #666 !important; --yt-spec-text-disabled: #666 !important; --yt-spec-call-to-action: #0073e6 !important; @@ -1654,8 +1661,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc } html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #e4ccaa !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1671,8 +1678,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc } html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #c7efcf; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -1686,11 +1693,12 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope), +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) { --yt-spec-icon-inactive: #666; --yt-spec-text-primary: #666; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); + --ytd-searchbox-background: #c7efcf; --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); @@ -1804,7 +1812,6 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc --yt-main-app-background-tmp: #c7efcf; --yt-guide-background: #c7efcf; --yt-dialog-background: #d6d1b1; - --yt-searchbox-background: #c7efcf; --yt-channel-header-background: #c7efcf; --yt-sidebar-background: #c7efcf; --yt-transcript-background: #c7efcf; @@ -1816,8 +1823,8 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc } html[it-theme=plain]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=plain][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=plain][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=plain][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.05) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.15) !important; @@ -1828,9 +1835,10 @@ html[data-system-color-scheme=light][it-theme=plain][it-schedule=system_peferenc /*SUNSET*/ +html[it-theme=sunset] [dark], html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]), -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark], -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark], +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light] { --yt-swatch-primary: #2f3364 !important; --yt-swatch-primary-darker: #2f3364 !important; --yt-swatch-text: rgb(255, 255, 255) !important; @@ -1851,8 +1859,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen --yt-spec-general-background-b: #2f3364 !important; --yt-spec-general-background-c: #2f3364 !important; --yt-spec-error-background: #1f1f1f !important; - --yt-spec-text-primary: #fff !important; - --yt-spec-text-primary-inverse: #003459 !important; + --yt-spec-text-primary: #fff; + --yt-spec-text-primary-inverse: #283567 !important; --yt-spec-text-secondary: #fff !important; --yt-spec-text-disabled: #fff !important; --yt-spec-call-to-action: #0073e6 !important; @@ -1883,8 +1891,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen } html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-masthead, -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark] ytd-masthead, -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] ytd-masthead { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-masthead, +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-masthead { background: #f56258 !important; --yt-swatch-primary: rgb(35, 35, 35) !important; --yt-swatch-primary-darker: rgb(32, 32, 32) !important; @@ -1900,8 +1908,8 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen } html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope), +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light]:not([style-scope]):not(.style-scope) *:not([style-scope]):not(.style-scope) { --yt-live-chat-action-panel-background-color: #2f3364; --yt-live-chat-action-panel-background-color-transparent: rgba(40, 40, 40, .8); --yt-live-chat-primary-text-color: hsl(0, 0%, 100%); @@ -1915,10 +1923,11 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not([style-scope]):not(.style-scope), html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]):not(.style-scope)[dark], html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) :not(.style-scope)[dark], -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark]:not(.style-scope)[dark], -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light]:not(.style-scope)[dark] { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark]:not(.style-scope)[dark], +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light]:not(.style-scope)[dark] { --yt-spec-icon-inactive: #fff; --ytd-searchbox-border-color: hsla(0, 0%, 53.3%, .2); + --ytd-searchbox-background: #fa7965; --ytd-searchbox-legacy-border-color: hsl(0, 0%, 18.82%); --ytd-searchbox-legacy-border-shadow-color: hsla(0, 0%, 0%, 0); --ytd-searchbox-legacy-button-color: hsla(0, 0%, 100%, .08); @@ -2032,7 +2041,6 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen --yt-main-app-background-tmp: #2f3364; --yt-guide-background: #2f3364; --yt-dialog-background: #d62828; - --yt-searchbox-background: #fa7965 !important; --yt-channel-header-background: #2f3364; --yt-sidebar-background: #2f3364; --yt-transcript-background: #2f3364; @@ -2044,11 +2052,52 @@ html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peferen } html[it-theme=sunset]:not([it-schedule=system_peference_dark]):not([it-schedule=system_peference_light]) ytd-expandable-metadata-renderer, -html[data-system-color-scheme=dark][it-theme=sunset][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, -html[data-system-color-scheme=light][it-theme=sunset][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { +html[it-theme=sunset][data-system-color-scheme=dark][it-schedule=system_peference_dark] ytd-expandable-metadata-renderer, +html[it-theme=sunset][data-system-color-scheme=light][it-schedule=system_peference_light] ytd-expandable-metadata-renderer { --yt-lightsource-section2-color: rgba(0, 0, 0, 0.1) !important; --yt-lightsource-section3-color: rgba(0, 0, 0, 0.2) !important; --yt-lightsource-section4-color: rgba(0, 0, 0, 0.3) !important; --yt-lightsource-primary-title-color: var(--yt-spec-text-primary) !important; --yt-lightsource-secondary-title-color: var(--yt-spec-text-secondary) !important; } + +/*------------------------------------------------------------------------------ +YT hardcoded CSS for DARK/light mode switching +Need HTML in front to make CSS rule more specific than one they are overiding +------------------------------------------------------------------------------*/ + +html .yt-spec-icon-shape, +html .yt-spec-icon-badge-shape--style-overlay .yt-spec-icon-badge-shape__icon, +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--text, +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html .yt-video-attribute-view-model__title { + color: var(--yt-spec-text-primary); +} + +/*Dark colors get highlight*/ +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { + background-color: rgba(255, 255, 255, 0.1); +} +/*Light colors get shadow, overrides above highlight*/ +html[it-theme=desert] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html[it-theme=plain] .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal, +html:not([dark]):not([it-theme=black]):not([it-theme=sunset]):not([it-theme=night]):not([it-theme=dawn]) .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--tonal { + background-color: rgba(0, 0, 0, 0.05) !important; +} + +/*subscribe button when not subscribed*/ +html .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--filled { + color: var(--yt-spec-base-background); + background-color: var(--yt-spec-text-primary); +} + +/*override bell and thumbs up icons hardcoded colors inside SVG data*/ +/*bell icon*/ +html .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="1"] { + fill: var(--yt-spec-text-primary); +} + +/*thumbs up icon*/ +html .yt-spec-button-shape-next__icon ytd-lottie-player svg path[fill-opacity="0"] { + stroke: var(--yt-spec-text-primary); +} From d936a03669f7069c2defde297c03028fa58a6059 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 5 May 2024 00:12:56 +0200 Subject: [PATCH 84/94] Update core.js master sync --- js&css/web-accessible/core.js | 43 +++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/js&css/web-accessible/core.js b/js&css/web-accessible/core.js index 8ed0cc949..f4694594f 100644 --- a/js&css/web-accessible/core.js +++ b/js&css/web-accessible/core.js @@ -47,7 +47,7 @@ var ImprovedTube = { focus: false, played_before_blur: false, played_time: 0, - ignore_autoplay_off: false, + user_interacted: false, mini_player__mode: false, mini_player__move: false, mini_player__cursor: '', @@ -76,28 +76,28 @@ CODEC || 30FPS file to patch HTMLMediaElement before YT player uses it. --------------------------------------------------------------*/ if (localStorage['it-codec'] || localStorage['it-player30fps']) { - function override(self, callback, mime) { + function overwrite(self, callback, mime) { if (localStorage['it-codec']) { - let re = new RegExp(localStorage['it-codec']); + var re = new RegExp(localStorage['it-codec']); // /webm|vp8|vp9|av01/ if (re.test(mime)) return ''; } if (localStorage['it-player30fps']) { - let match = /framerate=(\d+)/.exec(mime); + var match = /framerate=(\d+)/.exec(mime); if (match && match[1] > 30) return ''; } return callback.call(self, mime); }; if (window.MediaSource) { - let isTypeSupported = window.MediaSource.isTypeSupported; + var isTypeSupported = window.MediaSource.isTypeSupported; window.MediaSource.isTypeSupported = function (mime) { - return override(this, isTypeSupported, mime); + return overwrite(this, isTypeSupported, mime); } } - let canPlayType = HTMLMediaElement.prototype.canPlayType; + var canPlayType = HTMLMediaElement.prototype.canPlayType; HTMLMediaElement.prototype.canPlayType = function (mime) { - return override(this, canPlayType, mime); + return overwrite(this, canPlayType, mime); } }; @@ -156,23 +156,28 @@ document.addEventListener('it-message-from-extension', function () { ImprovedTube.storage = message.storage; if (ImprovedTube.storage.block_vp9 || ImprovedTube.storage.block_av1 || ImprovedTube.storage.block_h264) { - let atlas = {block_vp9:'vp9|vp09', block_h264:'avc1', block_av1:'av01'} - localStorage['it-codec'] = Object.keys(atlas).reduce(function (all, key) { + let atlas = {block_vp9:'vp9|vp09', block_h264:'avc1', block_av1:'av01'}, + codec = Object.keys(atlas).reduce(function (all, key) { return ImprovedTube.storage[key] ? ((all?all+'|':'') + atlas[key]) : all}, ''); - } else { + if (localStorage['it-codec'] != codec) { + localStorage['it-codec'] = codec; + } + } else if (localStorage['it-codec']) { localStorage.removeItem('it-codec'); } if (ImprovedTube.storage.player_60fps === false) { - localStorage['it-player30fps'] = true; - } else { + if (!localStorage['it-player30fps']) { + localStorage['it-player30fps'] = true; + } + } else if (localStorage['it-player30fps']) { localStorage.removeItem('it-player30fps'); } ImprovedTube.init(); // need to run blocklist once just after page load to catch initial nodes ImprovedTube.blocklist(); - - } else if (message.action === 'storage-changed') { // FEEDBACK WHEN USER CHANGES A SETTING + // REACTION OR VISUAL FEEDBACK WHEN THE USER CHANGES A SETTING (already automated for our CSS features): + } else if (message.action === 'storage-changed') { var camelized_key = message.camelizedKey; ImprovedTube.storage[message.key] = message.value; @@ -214,6 +219,7 @@ document.addEventListener('it-message-from-extension', function () { case 'theme': case 'themePrimaryColor': case 'themeTextColor': + ImprovedTube.myColors(); ImprovedTube.setTheme(); break @@ -223,7 +229,6 @@ document.addEventListener('it-message-from-extension', function () { } else if (ImprovedTube.storage.description === "normal" || ImprovedTube.storage.description === "classic") { try{document.querySelector("#less").click() || document.querySelector("#collapse").click();} catch{} } - ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer(); break case 'transcript': @@ -242,12 +247,12 @@ document.addEventListener('it-message-from-extension', function () { } break - case 'commentsSidebar': - if (ImprovedTube.storage.comments_sidebar === false) { + case 'commentsSidebarSimple': + if (ImprovedTube.storage.comments_sidebar_simple === false) { document.querySelector("#below").appendChild(document.querySelector("#comments")); document.querySelector("#secondary").appendChild(document.querySelector("#related")); } else { - ImprovedTube.commentsSidebar(); + ImprovedTube.commentsSidebarSimple(); } break From 9d463c0532163d60273dfea86ca6ad17303b8124 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 5 May 2024 01:23:34 +0200 Subject: [PATCH 85/94] Update init.js live blocklist sync --- js&css/extension/init.js | 52 +++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/js&css/extension/init.js b/js&css/extension/init.js index bd08ec575..5d01285c7 100644 --- a/js&css/extension/init.js +++ b/js&css/extension/init.js @@ -183,33 +183,37 @@ document.addEventListener('it-message-from-youtube', function () { }); } } else if (message.action === 'blocklist') { - var type = message.type, - id = message.id, - title = message.title; - if (!extension.storage.data.blocklist || typeof extension.storage.data.blocklist !== 'object') { extension.storage.data.blocklist = {}; } - if (type === 'channel') { - if (!extension.storage.data.blocklist.channels) { - extension.storage.data.blocklist.channels = {}; - } - - extension.storage.data.blocklist.channels[id] = { - title: title, - preview: message.preview - }; - } - - if (type === 'video') { - if (!extension.storage.data.blocklist.videos) { - extension.storage.data.blocklist.videos = {}; - } - - extension.storage.data.blocklist.videos[id] = { - title: title - }; + switch(message.type) { + case 'channel': + if (!extension.storage.data.blocklist.channels) { + extension.storage.data.blocklist.channels = {}; + } + if (message.added) { + extension.storage.data.blocklist.channels[message.id] = { + title: message.title, + preview: message.preview + } + } else { + delete extension.storage.data.blocklist.channels[message.id]; + } + break + + case 'video': + if (!extension.storage.data.blocklist.videos) { + extension.storage.data.blocklist.videos = {}; + } + if (message.added) { + extension.storage.data.blocklist.videos[message.id] = { + title: message.title + } + } else { + delete extension.storage.data.blocklist.videos[message.id]; + } + break } chrome.storage.local.set({ @@ -241,4 +245,4 @@ document.addEventListener('it-play', function (event) { var videos = document.querySelectorAll('video'); try {chrome.runtime.sendMessage({action: 'play'})} catch(error){console.log(error); setTimeout(function () { try { chrome.runtime.sendMessage({action: 'play'}, function (response) { console.log(response) } ); } catch { } }, 321) } - }); \ No newline at end of file + }); From 24d20a0d87fa0a2733b6718f9289082bc21bdaa3 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 5 May 2024 01:28:02 +0200 Subject: [PATCH 86/94] Update blocklist.js fixed for new layout? --- .../www.youtube.com/blocklist.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/blocklist.js b/js&css/web-accessible/www.youtube.com/blocklist.js index 907def59b..7a348daa1 100644 --- a/js&css/web-accessible/www.youtube.com/blocklist.js +++ b/js&css/web-accessible/www.youtube.com/blocklist.js @@ -89,7 +89,7 @@ ImprovedTube.blocklist = function (type, node) { const video = node.href.match(ImprovedTube.regex.video_id)?.[1], channel = node.parentNode.__dataHost?.__data?.data?.shortBylineText?.runs?.[0]?.navigationEndpoint?.commandMetadata?.webCommandMetadata?.url ? node.parentNode.__dataHost.__data.data.shortBylineText.runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url.match(ImprovedTube.regex.channel).groups.name : undefined, - data = this.parentNode.__dataHost.__data?.data, + data = this.parentNode.__dataHost.__data?.data?.title, blockedElement = node.blockedElement; let title, added = false, @@ -97,12 +97,10 @@ ImprovedTube.blocklist = function (type, node) { if (!video || !blockedElement) return; // need both video ID and blockedElement, otherwise bail - if (data?.title?.runs?.[0]?.text) { - title = data.title.runs[0].text; - } else if (data?.title?.simpleText) { - title = data.title.simpleText; - } else if (data?.headline?.simpleText) { - title = data.headline.simpleText; + if (data?.runs?.[0]?.text) { + title = data.runs[0].text; + } else if (data?.simpleText) { + title = data.simpleText; } if (channel && blockedElement.classList.contains('it-blocklisted-channel')) { @@ -160,7 +158,8 @@ ImprovedTube.blocklist = function (type, node) { } button.addEventListener('click', function (event) { - let data = this.parentNode.__dataHost.__data.data, + const data = ytInitialData.metadata.channelMetadataRenderer, + //let data = this.parentNode.__dataHost.__data.data, id = location.href.match(ImprovedTube.regex.channel).groups.name; if (this.added) { // adding @@ -190,8 +189,8 @@ ImprovedTube.blocklist = function (type, node) { for (let thumbnails of document.querySelectorAll('a.ytd-thumbnail[href]')) { this.blocklist('video', thumbnails); } - if (document.querySelector('ytd-subscribe-button-renderer.ytd-c4-tabbed-header-renderer')) { - this.blocklist('channel', document.querySelector('ytd-subscribe-button-renderer.ytd-c4-tabbed-header-renderer')); + if (document.querySelector('YT-SUBSCRIBE-BUTTON-VIEW-MODEL')) { + this.blocklist('channel', document.querySelector('YT-SUBSCRIBE-BUTTON-VIEW-MODEL')); } } } else { From 66384cb3d5694230fd0876868bc3c83fd5bd7763 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 5 May 2024 01:47:58 +0200 Subject: [PATCH 87/94] Update functions.js sync --- js&css/web-accessible/functions.js | 572 ++++++++++++++++------------- 1 file changed, 309 insertions(+), 263 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 6276c8325..75bab2248 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -1,258 +1,273 @@ /*-------------------------------------------------------------- >>> FUNCTIONS --------------------------------------------------------------*/ -const DOM_filter = /^(SCRIPT|DOM-IF|DOM-REPEAT|svg|SPAN||#text|#comment|yt-icon-shape|iron-iconset-svg)$/; +ImprovedTube.childHandler = function (node) { + //console.log(node.nodeName); + if (node.nodeName === 'SCRIPT' || node.nodeName === 'iron-iconset-svg' || node.nodeName === 'svg' || node.nodeName === 'SPAN' || node.nodeName === '#text' || node.nodeName === '#comment' || node.nodeName === 'yt-icon-shape' || node.nodeName === 'DOM-IF' || node.nodeName === 'DOM-REPEAT') { + return + } + var children = node.children; + this.ytElementsHandler(node); + + if (children) { + for (var i = 0, l = children.length; i < l; i++) { + ImprovedTube.childHandler(children[i]); + } + } +} + +/* +const DOM_filter = /^(SCRIPT|DOM-IF|DOM-REPEAT|svg|SPAN|#text|#comment|yt-icon-shape|iron-iconset-svg)$/; ImprovedTube.childHandler = function (node) { //console.log(node.nodeName); if (DOM_filter.test(node.nodeName)) { return; } - ImprovedTube.ytElementsHandler(node); - for (const child of node.children) { - ImprovedTube.childHandler(child); - } -}; + var children = node.children; + ImprovedTube.ytElementsHandler(node); + if (children) { + let i = 0; + for (const child of children) { + ImprovedTube.childHandler(children[i]); + //console.log("node.nodeName:CHILD-"+i+":"+children[i].id+",class:"+children[i].className+","+children[i]+"("+children[i].nodeName+")"); + i++; + } + } +}; */ ImprovedTube.ytElementsHandler = function (node) { - let id = node.id; + var name = node.nodeName, + id = node.id; - switch(node.nodeName) { - case 'A': - if (node.href) { - this.channelDefaultTab(node); + if (name === 'A') { + if (node.href) { + this.channelDefaultTab(node); - if (this.storage.blocklist_activate && node.classList.contains('ytd-thumbnail')) { + if (this.storage.blocklist_activate && node.classList.contains('ytd-thumbnail')) { this.blocklist('video', node); - } } - break; - /* var name = node.nodeName, - id = node.id; - else if (name === 'META') { // infos are not updated when clicking related videos... - if(node.getAttribute('name')) { - //if(node.getAttribute('name') === 'title') {ImprovedTube.title = node.content;} //duplicate - //if(node.getAttribute('name') === 'description') {ImprovedTube.description = node.content;} //duplicate - //if node.getAttribute('name') === 'themeColor') {ImprovedTube.themeColor = node.content;} //might help our darkmode/themes + } + } /* else if (name === 'META') { // infos are not updated when clicking related videos... + if(node.getAttribute('name')) { + //if(node.getAttribute('name') === 'title') {ImprovedTube.title = node.content;} //duplicate + //if(node.getAttribute('name') === 'description') {ImprovedTube.description = node.content;} //duplicate + //if node.getAttribute('name') === 'themeColor') {ImprovedTube.themeColor = node.content;} //might help our darkmode/themes //Do we need any of these here before the player starts? - //if(node.getAttribute('name') === 'keywords') {ImprovedTube.keywords = node.content;} - } else if (node.getAttribute('itemprop')) { - //if(node.getAttribute('itemprop') === 'name') {ImprovedTube.title = node.content;} - if(node.getAttribute('itemprop') === 'genre') {ImprovedTube.category = node.content;} - //if(node.getAttribute('itemprop') === 'channelId') {ImprovedTube.channelId = node.content;} - //if(node.getAttribute('itemprop') === 'videoId') {ImprovedTube.videoId = node.content;} + //if(node.getAttribute('name') === 'keywords') {ImprovedTube.keywords = node.content;} + } else if (node.getAttribute('itemprop')) { + //if(node.getAttribute('itemprop') === 'name') {ImprovedTube.title = node.content;} + if(node.getAttribute('itemprop') === 'genre') {ImprovedTube.category = node.content;} + //if(node.getAttribute('itemprop') === 'channelId') {ImprovedTube.channelId = node.content;} + //if(node.getAttribute('itemprop') === 'videoId') {ImprovedTube.videoId = node.content;} //The following infos will enable awesome, smart features. Some of which everyone should use. - //if(node.getAttribute('itemprop') === 'description') {ImprovedTube.description = node.content;} - //if(node.getAttribute('itemprop') === 'duration') {ImprovedTube.duration = node.content;} - //if(node.getAttribute('itemprop') === 'interactionCount'){ImprovedTube.views = node.content;} - //if(node.getAttribute('itemprop') === 'isFamilyFriendly'){ImprovedTube.isFamilyFriendly = node.content;} - //if(node.getAttribute('itemprop') === 'unlisted') {ImprovedTube.unlisted = node.content;} - //if(node.getAttribute('itemprop') === 'regionsAllowed'){ImprovedTube.regionsAllowed = node.content;} - //if(node.getAttribute('itemprop') === 'paid') {ImprovedTube.paid = node.content;} - // if(node.getAttribute('itemprop') === 'datePublished' ){ImprovedTube.datePublished = node.content;} - //to use in the "how long ago"-feature, not to fail without API key? just like the "day-of-week"-feature above - // if(node.getAttribute('itemprop') === 'uploadDate') {ImprovedTube.uploadDate = node.content;} - } - } */ - /* else if (name === 'TP-YT-PAPER-BUTTON') { - if ( (id === 'expand-sizer' || id === 'expand') && node.parentNode.id === 'description-inline-expander') { - setTimeout(function () { - ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY") - }, 750); - }} */ - case 'YTD-TOGGLE-BUTTON-RENDERER': - case 'YTD-PLAYLIST-LOOP-BUTTON-RENDERER': - //can be precise previously node.parentComponent & node.parentComponent.parentComponent - if (node.closest("YTD-MENU-RENDERER") && node.closest("YTD-PLAYLIST-PANEL-RENDERER")) { - var index = Array.prototype.indexOf.call(node.parentNode.children, node); - if (index === 0) { - if (this.storage.playlist_reverse === true) { - //can be precise: - try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode;} - catch{try{this.elements.playlist.actions = node;}catch{}} - } - } - } - } - this.playlistReverse(); - } else if (index === 1) { - this.elements.playlist.shuffle_button = node; - - this.playlistShuffle(); - - if (this.storage.playlist_reverse === true) { - //can be precise: - try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} - catch{try{this.elements.playlist.actions = node.parentNode;} - catch{try{this.elements.playlist.actions = node;}catch{}} - } - } - } - } - this.playlistReverse(); + //if(node.getAttribute('itemprop') === 'description') {ImprovedTube.description = node.content;} + //if(node.getAttribute('itemprop') === 'duration') {ImprovedTube.duration = node.content;} + //if(node.getAttribute('itemprop') === 'interactionCount'){ImprovedTube.views = node.content;} + //if(node.getAttribute('itemprop') === 'isFamilyFriendly'){ImprovedTube.isFamilyFriendly = node.content;} + //if(node.getAttribute('itemprop') === 'unlisted') {ImprovedTube.unlisted = node.content;} + //if(node.getAttribute('itemprop') === 'regionsAllowed'){ImprovedTube.regionsAllowed = node.content;} + //if(node.getAttribute('itemprop') === 'paid') {ImprovedTube.paid = node.content;} + // if(node.getAttribute('itemprop') === 'datePublished' ){ImprovedTube.datePublished = node.content;} + //to use in the "how long ago"-feature, not to fail without API key? just like the "day-of-week"-feature above + // if(node.getAttribute('itemprop') === 'uploadDate') {ImprovedTube.uploadDate = node.content;} + } + } */ + else if (name === 'YTD-TOGGLE-BUTTON-RENDERER' || name === 'YTD-PLAYLIST-LOOP-BUTTON-RENDERER') { + //can be precise previously node.parentComponent & node.parentComponent.parentComponent + if (node.closest("YTD-MENU-RENDERER") + && node.closest("YTD-PLAYLIST-PANEL-RENDERER")) { + + var index = Array.prototype.indexOf.call(node.parentNode.children, node); + if (index === 0) { + if (this.storage.playlist_reverse === true) { + //can be precise: + try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode;} + catch{try{this.elements.playlist.actions = node;}catch{}} + } + } + } } + this.playlistReverse(); + } else if (index === 1) { + this.elements.playlist.shuffle_button = node; + + this.playlistShuffle(); + + if (this.storage.playlist_reverse === true) { + //can be precise: + try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode.parentNode;} + catch{try{this.elements.playlist.actions = node.parentNode;} + catch{try{this.elements.playlist.actions = node;}catch{}} + } + } + } + } + this.playlistReverse(); } - this.playlistPopupUpdate(); - break; - case 'YTD-GUIDE-SECTION-RENDERER': - if (!this.elements.sidebar_section) { - this.elements.sidebar_section = node; + } + this.playlistPopupUpdate(); + } else if (name === 'YTD-GUIDE-SECTION-RENDERER') { + if (!this.elements.sidebar_section) { + this.elements.sidebar_section = node; + + this.improvedtubeYoutubeIcon(); + } + } else if (name === 'YTD-VIDEO-PRIMARY-INFO-RENDERER') { + this.elements.video_title = node.querySelector('.title.ytd-video-primary-info-renderer'); + + this.improvedtubeYoutubeIcon(); + this.improvedtubeYoutubeButtonsUnderPlayer(); - this.improvedtubeYoutubeIcon(); - } - break; - case 'YTD-VIDEO-PRIMARY-INFO-RENDERER': - this.elements.video_title = node.querySelector('.title.ytd-video-primary-info-renderer'); + + } else if (name === 'YTD-VIDEO-SECONDARY-INFO-RENDERER') { + this.elements.yt_channel_name = node.querySelector('ytd-channel-name'); + this.elements.yt_channel_link = node.querySelector('ytd-channel-name a'); + + if (document.documentElement.dataset.pageType === 'video') { + this.howLongAgoTheVideoWasUploaded(); + this.channelVideosCount(); + } + } + // else if (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-video-primary-info-renderer')) { + // if (document.documentElement.dataset.pageType === 'video') { + // this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); + // } + else if (name === 'YTD-PLAYLIST-HEADER-RENDERER' || (name === 'YTD-MENU-RENDERER' && node.classList.contains('ytd-playlist-panel-renderer'))) { + this.playlistPopupUpdate(); + } else if (name === 'YTD-SUBSCRIBE-BUTTON-RENDERER' || name === 'YT-SUBSCRIBE-BUTTON-VIEW-MODEL') { + if (this.storage.blocklist_activate) { + ImprovedTube.blocklist('channel', node); + } + + ImprovedTube.elements.subscribe_button = node; + } else if (id === 'chat-messages') { + this.elements.livechat.button = document.querySelector('[aria-label="Close"]'); + // console.log(document.querySelector('[aria-label="Close"]')) + this.livechat(); + } else if (name === 'YTD-MASTHEAD') { + if (!this.elements.masthead) { + this.elements.masthead = {start: node.querySelector('#start'), + end: node.querySelector('#end'), + logo: node.querySelector('a#logo') + }; this.improvedtubeYoutubeIcon(); - this.improvedtubeYoutubeButtonsUnderPlayer(); - break; - case 'YTD-VIDEO-SECONDARY-INFO-RENDERER': - this.elements.yt_channel_name = node.querySelector('ytd-channel-name'); - this.elements.yt_channel_link = node.querySelector('ytd-channel-name a'); - - if (document.documentElement.dataset.pageType === 'video') { - this.howLongAgoTheVideoWasUploaded(); - this.channelVideosCount(); - } - break; - case 'YTD-MENU-RENDERER': - case 'ytd-video-primary-info-renderer': - if (document.documentElement.dataset.pageType === 'video') { - this.hideDetailButton(node.querySelector('#flexible-item-buttons').children); - } - break; - case 'YTD-MENU-RENDERER': - if (!node.classList.contains('ytd-playlist-panel-renderer')) break; - /* FALLTHROUGH */ - case 'YTD-PLAYLIST-HEADER-RENDERER': - this.playlistPopupUpdate(); - break; - case 'YTD-SUBSCRIBE-BUTTON-RENDERER': - if (this.storage.blocklist_activate && node.classList.contains('ytd-c4-tabbed-header-renderer')) { - ImprovedTube.blocklist('channel', node); - } - ImprovedTube.elements.subscribe_button = node; - break; - case 'YTD-MASTHEAD': - if (!this.elements.masthead) { - this.elements.masthead = {start: node.querySelector('#start'), - end: node.querySelector('#end'), - logo: node.querySelector('a#logo') - }; - - this.improvedtubeYoutubeIcon(); - } - break; - case 'TP-YT-APP-DRAWER': - if (!this.elements.app_drawer) { - this.elements.app_drawer = {start: node.querySelector('div#header'), - logo: node.querySelector('a#logo') - }; - - this.improvedtubeYoutubeIcon(); - } - break; - case 'YTD-PLAYER': - if (!this.elements.ytd_player) { - ImprovedTube.elements.ytd_player = node; - } - break; - case 'YTD-WATCH-FLEXY': - this.elements.ytd_watch = node; - - if (this.isset(this.storage.player_size) && this.storage.player_size !== 'do_not_change') { - node.calculateCurrentPlayerSize_ = function () { - if (!this.theater && ImprovedTube.elements.player) { - if (this.updateStyles) { - this.updateStyles({'--ytd-watch-flexy-width-ratio': 1, - '--ytd-watch-flexy-height-ratio': 0.5625}); - - this.updateStyles({'--ytd-watch-width-ratio': 1, - '--ytd-watch-height-ratio': 0.5625}); + } + } + else if (name === 'TP-YT-APP-DRAWER') { + if (!this.elements.app_drawer) { + this.elements.app_drawer = {start: node.querySelector('div#header'), + logo: node.querySelector('a#logo') + }; + + this.improvedtubeYoutubeIcon(); + } + } else if (name === 'YTD-PLAYER') { + if (!this.elements.ytd_player) { + ImprovedTube.elements.ytd_player = node; + } + } else if (id === 'movie_player') { + if (!this.elements.player) { + ImprovedTube.elements.player = node; + // if (this.storage.player_autoplay === false) { ImprovedTube.elements.player.stopVideo(); } + ImprovedTube.elements.video = node.querySelector('video'); + ImprovedTube.elements.player_left_controls = node.querySelector('.ytp-left-controls'); + ImprovedTube.elements.player_right_controls = node.querySelector('.ytp-right-controls'); + ImprovedTube.elements.player_thumbnail = node.querySelector('.ytp-cued-thumbnail-overlay-image'); + ImprovedTube.elements.player_subtitles_button = node.querySelector('.ytp-subtitles-button'); + ImprovedTube.playerSize(); + if (typeof this.storage.ads !== 'undefined' && this.storage.ads !== "all_videos") { + new MutationObserver(function (mutationList) { + for (var i = 0, l = mutationList.length; i < l; i++) { + var mutation = mutationList[i]; + + if (mutation.type === 'childList') { + for (var j = 0, k = mutation.addedNodes.length; j < k; j++) { + var node = mutation.addedNodes[j]; + + if (node instanceof Element + && node.querySelector('ytp-ad-player-overlay, .ytp-ad-text, .ytp-ad-overlay-close-container, ytd-button-renderer#dismiss-button, *[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button.ytp-button, .ytp-ad-skip-button-modern.ytp-button') !== null) { + ImprovedTube.playerAds(node); + } + } + } + if (mutation.type === 'attributes' && mutation.attributeName === 'id' && mutation.target.querySelector('*[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button-modern.ytp-button',)){ + ImprovedTube.playerAds(node); } - return {width: ImprovedTube.elements.player.offsetWidth, - height: Math.round(ImprovedTube.elements.player.offsetWidth / (16 / 9))} } - return {width: NaN, // ?? - height: NaN} - } - node.calculateNormalPlayerSize_ = node.calculateCurrentPlayerSize_; // ?? + }).observe(node, {childList: true, // attributes: true, + subtree: true + }); } - break; - default: - if (id) { - if (id === 'show-hide-button') { - this.elements.livechat.button = document.querySelector('[aria-label="Hide chat"]'); - // console.log(document.querySelector('[aria-label="Hide chat"]')) - this.livechat(); - } else if (id === 'movie_player') { - if (!this.elements.player) { - ImprovedTube.elements.player = node; - // if (this.storage.player_autoplay === false) { ImprovedTube.elements.player.stopVideo(); } - ImprovedTube.elements.video = node.querySelector('video'); - ImprovedTube.elements.player_left_controls = node.querySelector('.ytp-left-controls'); - ImprovedTube.elements.player_right_controls = node.querySelector('.ytp-right-controls'); - ImprovedTube.elements.player_thumbnail = node.querySelector('.ytp-cued-thumbnail-overlay-image'); - ImprovedTube.elements.player_subtitles_button = node.querySelector('.ytp-subtitles-button'); - ImprovedTube.playerSize(); - if (typeof this.storage.ads !== 'undefined' && this.storage.ads !== "all_videos") { - new MutationObserver(function (mutationList) { - for (var i = 0, l = mutationList.length; i < l; i++) { - var mutation = mutationList[i]; - - if (mutation.type === 'childList') { - for (var j = 0, k = mutation.addedNodes.length; j < k; j++) { - var node = mutation.addedNodes[j]; - - if (node instanceof Element - && node.querySelector('ytp-ad-player-overlay, .ytp-ad-text, .ytp-ad-overlay-close-container, ytd-button-renderer#dismiss-button, *[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button.ytp-button, .ytp-ad-skip-button-modern.ytp-button') !== null) { - ImprovedTube.playerAds(node); - } - } - } - if (mutation.type === 'attributes' && mutation.attributeName === 'id' && mutation.target.querySelector('*[id^="ad-text"], *[id^="skip-button"], .ytp-ad-skip-button-modern.ytp-button',)){ - ImprovedTube.playerAds(node); - } - } - }).observe(node, {childList: true, // attributes: true, - subtree: true - }); + + new MutationObserver(function (mutationList) { + for (var i = 0, l = mutationList.length; i < l; i++) { + var mutation = mutationList[i]; + + if (mutation.type === 'attributes') { + if (mutation.attributeName === 'style') { + ImprovedTube.playerHdThumbnail(); } - - new MutationObserver(function (mutationList) { - for (var i = 0, l = mutationList.length; i < l; i++) { - var mutation = mutationList[i]; - - if (mutation.type === 'attributes') { - if (mutation.attributeName === 'style') { - ImprovedTube.playerHdThumbnail(); - } - } - } - }).observe(ImprovedTube.elements.player_thumbnail, {attributes: true, - attributeFilter: ['style'], - childList: false, - subtree: false - }); } - } else if (document.documentElement.dataset.pageType === 'video') { - if (id === 'description-inline-expander' || id === 'description-inner') { - setTimeout(function () {ImprovedTube.expandDescription(node);}, 300); - } else if (id === 'meta') {setTimeout(function () {ImprovedTube.expandDescription(node.querySelector('#more'));}, 200); - } else if (id === 'below') { - setTimeout(function () {}, 0); - } else if (id === 'panels') { - setTimeout(function () { - ImprovedTube.transcript(node); - ImprovedTube.chapters(node); - }, 200); - } } - } - break; + }).observe(ImprovedTube.elements.player_thumbnail, {attributes: true, + attributeFilter: ['style'], + childList: false, + subtree: false + }); + } + } else if (name === 'YTD-WATCH-FLEXY') { + this.elements.ytd_watch = node; + + if ( + this.isset(this.storage.player_size) && + this.storage.player_size !== 'do_not_change' + ) { + node.calculateCurrentPlayerSize_ = function () { + if (!this.theater && ImprovedTube.elements.player) { + if (this.updateStyles) { + this.updateStyles({'--ytd-watch-flexy-width-ratio': 1, + '--ytd-watch-flexy-height-ratio': 0.5625 + }); + + this.updateStyles({'--ytd-watch-width-ratio': 1, + '--ytd-watch-height-ratio': 0.5625 + }); + } + + return {width: ImprovedTube.elements.player.offsetWidth, + height: Math.round(ImprovedTube.elements.player.offsetWidth / (16 / 9)) + }; + } + + return {width: NaN, // ?? + height: NaN + }; + }; + + node.calculateNormalPlayerSize_ = node.calculateCurrentPlayerSize_; // ?? + } + } else if (document.documentElement.dataset.pageType === 'video') { + if (id === 'description-inline-expander' || id === 'description-inner') { + setTimeout(function () {ImprovedTube.expandDescription(node);}, 300); + } else if (id === 'meta') {setTimeout(function () {ImprovedTube.expandDescription(node.querySelector('#more'));}, 200); + } else if (id === 'below') { + setTimeout(function () {}, 0); + } else if (id === 'panels') { + setTimeout(function () { + ImprovedTube.transcript(node); + ImprovedTube.chapters(node); + }, 200); + } /* else if (name === 'TP-YT-PAPER-BUTTON') { + if ( (id === 'expand-sizer' || id === 'expand') && node.parentNode.id === 'description-inline-expander') { + setTimeout(function () { + ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY") + }, 750); + }} */ } + }; ImprovedTube.pageType = function () { @@ -272,6 +287,7 @@ ImprovedTube.pageType = function () { ImprovedTube.pageOnFocus = function () { ImprovedTube.playerAutopauseWhenSwitchingTabs(); ImprovedTube.playerAutoPip(); + ImprovedTube.playerQualityWithoutFocus(); }; ImprovedTube.videoPageUpdate = function () { @@ -300,6 +316,7 @@ ImprovedTube.videoPageUpdate = function () { ImprovedTube.playerRotateButton(); ImprovedTube.playerPopupButton(); ImprovedTube.playerFitToWinButton(); + ImprovedTube.playerCinemaModeButton(); ImprovedTube.playerHamburgerButton(); ImprovedTube.playerControls(); } @@ -320,8 +337,9 @@ ImprovedTube.playerOnPlay = function () { this.removeEventListener('ended', ImprovedTube.playerOnEnded, true); this.addEventListener('ended', ImprovedTube.playerOnEnded, true); - ImprovedTube.autoplay(); + ImprovedTube.autoplayDisable(this); ImprovedTube.playerLoudnessNormalization(); + ImprovedTube.playerCinemaModeEnable(); return original.apply(this, arguments); } @@ -349,6 +367,7 @@ ImprovedTube.initPlayer = function () { ImprovedTube.subtitlesCharacterEdgeStyle(); ImprovedTube.subtitlesFontOpacity(); ImprovedTube.subtitlesBackgroundOpacity(); + ImprovedTube.subtitlesDisableLyrics(); ImprovedTube.playerQuality(); ImprovedTube.playerVolume(); if (this.storage.player_always_repeat === true) { ImprovedTube.playerRepeat(); } @@ -365,23 +384,35 @@ ImprovedTube.initPlayer = function () { } }; -ImprovedTube.playerOnTimeUpdate = function () { - if (ImprovedTube.video_src !== this.src) { - ImprovedTube.video_src = this.src; - - if (ImprovedTube.initialVideoUpdateDone !== true) { - ImprovedTube.playerQuality(); - } - } else if (ImprovedTube.latestVideoDuration !== this.duration) { - ImprovedTube.latestVideoDuration = this.duration; +var timeUpdateInterval = null; +var noTimeUpdate = null; - ImprovedTube.playerQuality(); - } +ImprovedTube.playerOnTimeUpdate = function() { + var currentTime = Date.now(); + if (!timeUpdateInterval) { + timeUpdateInterval = setInterval(function() { + if (ImprovedTube.video_src !== this.src) { + ImprovedTube.video_src = this.src; - ImprovedTube.alwaysShowProgressBar(); - ImprovedTube.playerRemainingDuration(); + if (ImprovedTube.initialVideoUpdateDone !== true) { + ImprovedTube.playerQuality(); + } + } else if (ImprovedTube.latestVideoDuration !== this.duration) { + ImprovedTube.latestVideoDuration = this.duration; + + ImprovedTube.playerQuality(); + } - ImprovedTube.played_time += .25; + ImprovedTube.alwaysShowProgressBar(); + ImprovedTube.playerRemainingDuration(); + ImprovedTube.played_time += .5; + }, 500); + } + clearInterval(noTimeUpdate); + noTimeUpdate = setTimeout(function() { + clearInterval(timeUpdateInterval); + timeUpdateInterval = null; + }, 987); }; ImprovedTube.playerOnLoadedMetadata = function () { @@ -399,6 +430,8 @@ ImprovedTube.playerOnPause = function (event) { } ImprovedTube.played_time = 0; ImprovedTube.playerControls(); + ImprovedTube.playerCinemaModeDisable(); + }; ImprovedTube.playerOnEnded = function (event) { @@ -415,27 +448,34 @@ ImprovedTube.playerOnEnded = function (event) { ImprovedTube.onkeydown = function () { window.addEventListener('keydown', function () { - if (ImprovedTube.elements.player && ImprovedTube.elements.player.className.indexOf('ad-showing') === -1) { - ImprovedTube.ignore_autoplay_off = true; + if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { + ImprovedTube.user_interacted = true; } }, true); }; ImprovedTube.onmousedown = function (event) { + window.addEventListener('mousedown', function (event) { - if (ImprovedTube.elements.player && ImprovedTube.elements.player.className.indexOf('ad-showing') === -1) { + + if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { var path = event.composedPath(); for (var i = 0, l = path.length; i < l; i++) { if (path[i].className && path[i].className.indexOf - && (path[i].className.indexOf('html5-main-video') !== -1 + && (path[i].className.indexOf('html5-video-container') !== -1 || path[i].className.indexOf('ytp-play-button') !== -1)) { - ImprovedTube.ignore_autoplay_off = true; + ImprovedTube.user_interacted = true; } } + } }, true); + + + + }; ImprovedTube.getParam = function (query, name) { @@ -480,24 +520,30 @@ ImprovedTube.getCookieValueByName = function (name) { } else return ''; }; -ImprovedTube.setPrefCookieValueByName = function (name, value) { +ImprovedTube.getPrefCookieValueByName = function (name) { let prefs = this.getParams(this.getCookieValueByName('PREF')); - let newprefs = ''; + return prefs[name]; +}; + +// set PREF cookie name=value or delete name if value == null +ImprovedTube.setPrefCookieValueByName = function (name, value) { + let originalPref = this.getCookieValueByName('PREF'); + let prefs = this.getParams(originalPref); + let newPrefs = ''; let ampersant = ''; - if (value) { - prefs[name] = value; - } + prefs[name] = value; for (let pref in prefs) { - if (pref) { - if (pref!=name || value) { - newprefs += ampersant + pref + '=' + prefs[pref]; - ampersant = '&'; - } + if (prefs[pref]) { + newPrefs += ampersant + pref + '=' + prefs[pref]; + ampersant = '&'; } } - this.setCookie('PREF', newprefs); + // only write cookie if its different from the old one + if (originalPref != newPrefs) { + this.setCookie('PREF', newPrefs); + } }; ImprovedTube.setCookie = function (name, value) { @@ -510,7 +556,6 @@ ImprovedTube.setCookie = function (name, value) { ImprovedTube.createPlayerButton = function (options) { var controls = options.position == "right" ? this.elements.player_right_controls : this.elements.player_left_controls; - if (controls) { var button = document.createElement('button'); @@ -528,7 +573,8 @@ ImprovedTube.createPlayerButton = function (options) { tooltip.style.top = rect.top - 8 + 'px'; tooltip.textContent = this.dataset.title; - +if (this.storage.player_cinema_mode_button || this.storage.player_auto_hide_cinema_mode_when_paused || this.storage.player_auto_cinema_mode){ +tooltip.style.zIndex = 10001;} // needed for cinema mode function mouseleave() { tooltip.remove(); From 6bf2c090a0434925e16e4a6fb95cbb0ae3f11d45 Mon Sep 17 00:00:00 2001 From: Rasz_pl Date: Sun, 5 May 2024 02:00:31 +0200 Subject: [PATCH 88/94] Update blocklist.js counters in menu --- menu/skeleton-parts/blocklist.js | 58 +++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/menu/skeleton-parts/blocklist.js b/menu/skeleton-parts/blocklist.js index 30ddcf81f..d18a7f9be 100644 --- a/menu/skeleton-parts/blocklist.js +++ b/menu/skeleton-parts/blocklist.js @@ -20,18 +20,21 @@ extension.skeleton.main.layers.section.blocklist = { channels: { component: 'button', text: 'channels', + style: { + justifyContent: 'space-between' + }, on: { click: { component: 'section', variant: 'card', on: { render: function () { - var skeleton = {}, + let skeleton = {}, blocklist = satus.storage.get('blocklist'); if (blocklist && blocklist.channels) { - for (var key in blocklist.channels) { - var channel = blocklist.channels[key]; + for (let key in blocklist.channels) { + let channel = blocklist.channels[key]; if (channel !== false) { skeleton[key] = { @@ -49,7 +52,7 @@ extension.skeleton.main.layers.section.blocklist = { component: 'button', on: { click: function () { - var blocklist = satus.storage.get('blocklist'), + let blocklist = satus.storage.get('blocklist'), component = this.parentNode; if (blocklist && blocklist.channels) { @@ -93,23 +96,43 @@ extension.skeleton.main.layers.section.blocklist = { } } } + }, + list: { + component: 'span', + style: { + opacity: .64 + }, + on: { + render: function () { + let blocklist = satus.storage.get('blocklist'); + + if (blocklist && blocklist.channels && Object.keys(blocklist.channels).length) { + this.textContent = '('+Object.keys(blocklist.channels).length+')'; + } else { + this.textContent = '(empty)'; + } + } + } } }, videos: { component: 'button', text: 'videos', + style: { + justifyContent: 'space-between' + }, on: { click: { component: 'section', variant: 'card', on: { render: function () { - var skeleton = {}, + let skeleton = {}, blocklist = satus.storage.get('blocklist'); if (blocklist && blocklist.videos) { - for (var key in blocklist.videos) { - var video = blocklist.videos[key]; + for (let key in blocklist.videos) { + let video = blocklist.videos[key]; if (video !== false) { skeleton[key] = { @@ -127,7 +150,7 @@ extension.skeleton.main.layers.section.blocklist = { component: 'button', on: { click: function () { - var blocklist = satus.storage.get('blocklist'), + let blocklist = satus.storage.get('blocklist'), component = this.parentNode; if (blocklist && blocklist.videos) { @@ -171,6 +194,23 @@ extension.skeleton.main.layers.section.blocklist = { } } } + }, + list: { + component: 'span', + style: { + opacity: .64 + }, + on: { + render: function () { + let blocklist = satus.storage.get('blocklist'); + + if (blocklist && blocklist.videos && Object.keys(blocklist.videos).length) { + this.textContent = '('+Object.keys(blocklist.videos).length+')'; + } else { + this.textContent = '(empty)'; + } + } + } } } } @@ -210,4 +250,4 @@ extension.skeleton.main.layers.section.blocklist = { component: 'span', text: 'blocklist' } -}; \ No newline at end of file +}; From 89932d18d1dab8741937337f97320b3f927f4ba0 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Sun, 5 May 2024 20:02:48 +0200 Subject: [PATCH 89/94] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 49 +++++++++++++--------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 22079ecf1..e3ee3df45 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,33 +8,30 @@ assignees: '' --- ## 1. Bug Report: - ⚬ **BUG**: - ⚬ Browser: - ⚬ **HOW**: - ⚬ Does the bug not happen when you log out of YouTube? Or did YouTube change at all? - Then please check your 800+ experiment flags list with and without the error: Enter: yt.config_.EXPERIMENT_FLAGS into the Browser console on youtube (F12-Key). (Messy alternative: Copy the html-source you get with ctrl+U.) - ⚬ *Or* did our last update start the bug? - ⚬ Are any *Browser console errors shown? `F12`-key - ⚬ ImprovedTube Version: - - ⚬ *Screenshots*: - ⚬ *Expected /preferred behavior*: - ⚬ *Context*: + - **BUG**: + - Browser: + - **HOW**: + - Did YouTube change? + - Does the bug not happen when you log out of YouTube? Then please copy your experiment flags list with & without the error, so we can compare: Enter: ´yt.config_.EXPERIMENT_FLAGS´ into the Browser console on youtube (F12-Key). (can also copy them from the html source(ctrl+U)) + - *Or* did our last update start the bug? + - Then Are any *Browser console errors shown? `F12`-key + - *Expected /preferred behavior: + - ImprovedTube Version: -### Step-0 / Before submitting -Thanks for coming & caring! Please check if the issue has already been reported ever. ( With [GitHub's issue search (use this link)](https://github.com/ImprovedTube/ImprovedTube/issues?q=) -(else removing "is:issue is:open" from the standard search) +### STEP-0: (before submitting) +Thanks for coming & caring! Please check if the issue has already been reported ever. ( With [GitHub's issue search (use this link)](https://github.com/ImprovedTube/ImprovedTube/issues?q=) (else removing "is:issue is:open" from the standard search) + - -### More: - ⚬ Tested alone without other YouTube extensions or in incognito mode? Yes/No - ⚬ My Settings:
List your settings or export them to paste or attach - - ⚬ DOM:
maybe attach or paste collapsed (here)
(How-To: https://github.com/code-charity/youtube/wiki/Contributing#Test ) -⚬ OS: -⚬ Device: +### More: + - Tested alone without other YouTube extensions or in incognito mode? Yes/No + - My Settings: + - DOM:
or paste collapsed: + here (How-To: https://github.com/code-charity/youtube/wiki/Contributing#Test )
+ - OS: + - Device: From e56ddb2ef2964d3e2c58f248b8df5dcc9268c509 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Mon, 6 May 2024 11:58:49 +0200 Subject: [PATCH 90/94] user_interacted #2177 --- js&css/web-accessible/functions.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 9713f1c23..91c02ecb6 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -454,21 +454,19 @@ ImprovedTube.onkeydown = function () { }, true); }; -ImprovedTube.onmousedown = function (event) { - - window.addEventListener('mousedown', function (event) { - if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { - var path = event.composedPath(); - - for (var i = 0, l = path.length; i < l; i++) { - if (path[i].className - && path[i].className.indexOf - && (path[i].className.indexOf('html5-video-container') !== -1 - || path[i].className.indexOf('ytp-play-button') !== -1)) { - ImprovedTube.user_interacted = true; +ImprovedTube.onmousedown = function (event) { + window.addEventListener('mousedown', function (event) { + if (!ImprovedTube.user_interacted) { + setTimeout(function(){ImprovedTube.user_interacted = true},800); + if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { + var path = event.composedPath(); + for (var i = 0, l = path.length; i < l; i++) { + if (path[i].className + // && path[i].className.indexOf + && (/html5-(main-video|video-container)|ytp-play-button/.test(path[i].className)) + ) {ImprovedTube.user_interacted = true;} } - } - + } } }, true); }; From 1737326b2ac6048b603134ab9cbb22eb723c81fa Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Mon, 6 May 2024 13:57:33 +0200 Subject: [PATCH 91/94] Update player.js --- js&css/web-accessible/www.youtube.com/player.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index b79e34a4d..0c936602c 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -3,31 +3,31 @@ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ ImprovedTube.autoplayDisable = function (videoElement) { if (ImprovedTube.storage.player_autoplay_disable - || ImprovedTube.storage.playlist_autoplay === false || ImprovedTube.storage.channel_trailer_autoplay === false){ + || ImprovedTube.storage.playlist_autoplay === false || ImprovedTube.storage.channel_trailer_autoplay === false){ const video = ImprovedTube.elements.player || videoElement.closest('#movie_player'); if (ImprovedTube.video_url !== location.href) { this.user_interacted = false; } // if (no user clicks) and (no ads playing) and // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) - // user didnt click + // user didnt click if (video && !this.user_interacted - // no ads playing + // no ads playing && !video.classList.contains('ad-showing') - // video + // video && ((location.href.includes('/watch?') // #1703 - // player_autoplay_disable & not playlist + // player_autoplay_disable & not playlist && (ImprovedTube.storage.player_autoplay_disable && !location.href.includes('list=')) - // !playlist_autoplay & playlist + // !playlist_autoplay & playlist || (ImprovedTube.storage.playlist_autoplay === false && location.href.includes('list='))) - // channel homepage & !channel_trailer_autoplay + // channel homepage & !channel_trailer_autoplay || (ImprovedTube.storage.channel_trailer_autoplay === false && ImprovedTube.regex.channel.test(location.href)))) { if (!ImprovedTube.autoplayDeniedOnce) { setTimeout(function () { video.pauseVideo(); }); ImprovedTube.autoplayDeniedOnce = true; } else { video.pauseVideo(); - console.log("autoplay:off - should we pause here again?"); + console.log("autoplay:off - should we pause here again?"); } } } From e3fee6d519d2414bd3814b0e1eeb1ac87d7cc2fc Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Mon, 6 May 2024 13:59:47 +0200 Subject: [PATCH 92/94] Update player.js --- js&css/web-accessible/www.youtube.com/player.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 0c936602c..c9005e777 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -10,17 +10,17 @@ if (ImprovedTube.storage.player_autoplay_disable // if (no user clicks) and (no ads playing) and // ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) ) - // user didnt click + // user didnt click if (video && !this.user_interacted - // no ads playing + // no ads playing && !video.classList.contains('ad-showing') - // video + // video && ((location.href.includes('/watch?') // #1703 - // player_autoplay_disable & not playlist + // player_autoplay_disable & not playlist && (ImprovedTube.storage.player_autoplay_disable && !location.href.includes('list=')) - // !playlist_autoplay & playlist + // !playlist_autoplay & playlist || (ImprovedTube.storage.playlist_autoplay === false && location.href.includes('list='))) - // channel homepage & !channel_trailer_autoplay + // channel homepage & !channel_trailer_autoplay || (ImprovedTube.storage.channel_trailer_autoplay === false && ImprovedTube.regex.channel.test(location.href)))) { if (!ImprovedTube.autoplayDeniedOnce) { @@ -28,7 +28,7 @@ if (ImprovedTube.storage.player_autoplay_disable ImprovedTube.autoplayDeniedOnce = true; } else { video.pauseVideo(); console.log("autoplay:off - should we pause here again?"); - } + } } } }; From fc101e03bffbe18bb5192049999736c72a91814f Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Mon, 6 May 2024 14:09:45 +0200 Subject: [PATCH 93/94] user_interacted from autoplay-off to initplayer() --- js&css/web-accessible/functions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 91c02ecb6..ce982c9fb 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -349,7 +349,8 @@ ImprovedTube.playerOnPlay = function () { ImprovedTube.initPlayer = function () { if (ImprovedTube.elements.player && ImprovedTube.video_url !== location.href) { - ImprovedTube.video_url = location.href; + ImprovedTube.video_url = location.href; + ImprovedTube.user_interacted = false; ImprovedTube.played_before_blur = false; delete ImprovedTube.elements.player.dataset.defaultQuality; From 2df3a5edbee00c3b1ec4bfb5d52d6674df03c13d Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Mon, 6 May 2024 14:54:20 +0200 Subject: [PATCH 94/94] autoplay-off: waitForVideo --- js&css/web-accessible/www.youtube.com/player.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index c9005e777..b9aaab66b 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -3,8 +3,15 @@ AUTOPLAY DISABLE ------------------------------------------------------------------------------*/ ImprovedTube.autoplayDisable = function (videoElement) { if (ImprovedTube.storage.player_autoplay_disable - || ImprovedTube.storage.playlist_autoplay === false || ImprovedTube.storage.channel_trailer_autoplay === false){ - const video = ImprovedTube.elements.player || videoElement.closest('#movie_player'); + || ImprovedTube.storage.playlist_autoplay === false + || ImprovedTube.storage.channel_trailer_autoplay === false){ + let video; let tries=0; + (function waitForVideo(){if(video=ImprovedTube.elements.player||videoElement.closest('#movie_player')){return;} + else if(tries++<4){ + console.log("autoplayOff is waiting for ImprovedTube.elements.player or #movie_player"); + setTimeout(waitForVideo,500); + }else if(tries===4){console.error("resigning autoplayOff after 1.5s")} + })() if (ImprovedTube.video_url !== location.href) { this.user_interacted = false; } // if (no user clicks) and (no ads playing) and