Skip to content

Commit

Permalink
Merge pull request #2176 from ADTmux/issue#2171
Browse files Browse the repository at this point in the history
Added Fix for buttons below the player
  • Loading branch information
ImprovedTube authored Apr 10, 2024
2 parents 04a604b + d547665 commit 03db5fa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 40 deletions.
50 changes: 25 additions & 25 deletions js&css/extension/www.youtube.com/appearance/details/details.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -37,55 +37,55 @@ 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------*/
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;}
/*---------------------------------*/
Expand Down
9 changes: 5 additions & 4 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
22 changes: 11 additions & 11 deletions js&css/web-accessible/www.youtube.com/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------------------------------------------------*/
Expand Down

0 comments on commit 03db5fa

Please sign in to comment.