YouTube Q2 2023 rounded UI

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

As of 2023-11-23. See the latest version.

// ==UserScript==
// @name         YouTube Q2 2023 rounded UI
// @version      20231123.06.07
// @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 });

(function() {
ApplyCSS();
function ApplyCSS() {
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 {
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;
}`
document.head.appendChild(styles);
}
})();