YouTube Q2 2023 rounded UI

This is the version of YouTube Rounded UI from April to June 2923.

Ekde 2023/12/21. Vidu La ĝisdata versio.

// ==UserScript==
// @name         YouTube Q2 2023 rounded UI
// @version      20231221.05.21
// @description  This is the version of YouTube Rounded UI from April to June 2923.
// @author       xX_LegendCraftd_Xx
// @icon         https://www.youtube.com/favicon.ico
// @namespace    https://greasyfork.org/en/users/933798
// @license      MIT
// @match        *://www.youtube.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==
// Enable strict mode to catch common coding mistakes
"use strict";

// Define the flags to assign to the EXPERIMENT_FLAGS object
const flagsToAssign = {
  kevlar_watch_grid: false,
  kevlar_watch_grid_hide_chips: false,
  kevlar_watch_metadata_refresh_no_old_secondary_data: false,
  enable_channel_page_header_profile_section: false,
  kevlar_modern_sd_v2: false,
  kevlar_watch_comments_panel_button: false,
  smartimation_background: false,
  web_animated_actions: false,
  web_modern_collections_v2: false,
  web_modern_tabs: false,
  web_modern_typography: false,
  web_enable_youtab: false,
  web_watch_rounded_player_large: false,
};

const updateFlags = () => {
  // Check if the EXPERIMENT_FLAGS object exists in the window.yt.config_ property chain
  const expFlags = window?.yt?.config_?.EXPERIMENT_FLAGS;

  // If EXPERIMENT_FLAGS is not found, exit the function
  if (!expFlags) return;

  // Assign the defined flags to the EXPERIMENT_FLAGS object
  Object.assign(expFlags, flagsToAssign);
};

// Create a MutationObserver that calls the updateFlags function when changes occur in the document's subtree
const mutationObserver = new MutationObserver(updateFlags);
mutationObserver.observe(document, { subtree: true, childList: true });

var styles = document.createElement("style");
styles.innerHTML=`
div#chip-bar.style-scope.ytd-search-header-renderer > yt-chip-cloud-renderer.style-scope.ytd-search-header-renderer > div#container.style-scope.yt-chip-cloud-renderer {
display: none !important;
}
ytd-watch-flexy[rounded-player-large]:not([fullscreen]):not([theater]) #ytd-player.ytd-watch-flexy {
border-radius: 0px !important;
}
#voice-search-button.ytd-masthead {
background-color: var(--yt-spec-general-background-a) !important;
margin-left: 4px !important;
}
[page-subtype="history"] #channel-header.ytd-tabbed-page-header {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.page-header-view-model-wiz__page-header-title--page-header-title-large {
margin-top: 24px !important;
margin-bottom: 8px !important;
color: var(--yt-spec-text-primary) !important;
font-size: 1.6em !important;
line-height: 1.4em !important;
font-weight: 500 !important;
}
#avatar.ytd-c4-tabbed-header-renderer {
width: 128px !important;
height: 128px !important;
margin-bottom: 12px !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] #channel-name.ytd-c4-tabbed-header-renderer {
font-size: 2.4em !important;
font-weight: 400 !important;
line-height: var(--yt-channel-title-line-height, 3rem) !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] #channel-handle.ytd-c4-tabbed-header-renderer {
font-weight: 500 !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] #channel-pronouns.ytd-c4-tabbed-header-renderer,
yt-formatted-string#channel-pronouns.style-scope.ytd-c4-tabbed-header-renderer {
display: none !important;
}
span.delimiter.style-scope.ytd-c4-tabbed-header-renderer {
display: none !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] .meta-item.ytd-c4-tabbed-header-renderer {
margin-right: 8px !important;
}
div#meta.style-scope.ytd-c4-tabbed-header-renderer {
width: auto !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] #inner-header-container.ytd-c4-tabbed-header-renderer {
flex-direction: row !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] #channel-header-container.ytd-c4-tabbed-header-renderer {
padding-top: 8px !important;
margin-bottom: 0px !important;
}
div.page-header-banner.style-scope.ytd-c4-tabbed-header-renderer {
margin-left: 0px !important;
margin-right: 0px !important;
border-radius: 0px !important;
}
ytd-c4-tabbed-header-renderer[use-page-header-style] .page-header-banner.ytd-c4-tabbed-header-renderer {
border-radius: 0px !important;
}
.yt-tab-shape-wiz {
padding: 0 32px !important;
margin-right: 0 !important;
}
.yt-tab-shape-wiz__tab {
font-size: 14px !important;
font-weight: 500 !important;
letter-spacing: var(--ytd-tab-system-letter-spacing) !important;
text-transform: uppercase !important;
}
.yt-tab-group-shape-wiz__slider {
display: none !important;
}
.yt-tab-shape-wiz__tab-bar {
display: none !important;
}
yt-formatted-string.style-scope.yt-chip-cloud-chip-renderer {
font-weight: 400 !important;
}
span.style-scope.ytd-rich-shelf-renderer {
font-weight: 400 !important;
}
span.style-scope.ytd-shelf-renderer {
font-size: 1.6rem !important;
font-weight: 500 !important;
}
.count-text.ytd-comments-header-renderer {
font-size: 1.6rem !important;
line-height: 2.2rem !important;
font-weight: 400 !important;
}
ytd-watch-metadata[title-headline-xs] h1.ytd-watch-metadata {
font-family: "YouTube Sans","Roboto",sans-serif !important;
font-weight: 600 !important;
}
.ytp-tooltip.ytp-rounded-tooltip.ytp-preview:not(.ytp-text-detail), .ytp-tooltip.ytp-rounded-tooltip.ytp-preview:not(.ytp-text-detail) .ytp-tooltip-bg {
border-radius: 2px !important;
}
[d*="m12.71 12 8.15 8.15-.71.71L12 12.71l-8.15 8.15-.71-.71L11.29 12 3.15 3.85l.71-.71L12 11.29l8.15-8.15.71.71L12.71 12z"] {
d: path("M12.7,12l6.6,6.6l-0.7,0.7L12,12.7l-6.6,6.6l-0.7-0.7l6.6-6.6L4.6,5.4l0.7-0.7l6.6,6.6l6.6-6.6l0.7,0.7L12.7,12z");
}
[d*="M18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11ZM16.2961 16.9961C14.8853 18.2431 13.031 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11C19 13.0274 18.2458 14.8786 17.0028 16.2885L20.5583 19.8441L20.9119 20.1976L20.2048 20.9047L19.8512 20.5512L16.2961 16.9961Z"] {
d: path("m20.87 20.17-5.59-5.59C16.35 13.35 17 11.75 17 10c0-3.87-3.13-7-7-7s-7 3.13-7 7 3.13 7 7 7c1.75 0 3.35-.65 4.58-1.71l5.59 5.59.7-.71zM10 16c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6z");
}
`;
document.head.appendChild(styles);