@@ -39,6 +39,8 @@ let defaultConfig = {
3939 hideVoiceSearch : false ,
4040 hideWatched : true ,
4141 hideWatchedThreshold : '80' ,
42+ playerHideFullScreenControls : false ,
43+ playerHideFullScreenMoreVideos : false ,
4244 redirectShorts : true ,
4345 removePink : false ,
4446 stopShortsLooping : true ,
@@ -50,6 +52,7 @@ let defaultConfig = {
5052 fullSizeTheaterMode : false ,
5153 fullSizeTheaterModeHideHeader : true ,
5254 fullSizeTheaterModeHideScrollbar : false ,
55+ hideChannelWatermark : false ,
5356 hideChat : false ,
5457 hideCollaborations : false ,
5558 hideEndCards : false ,
@@ -63,9 +66,9 @@ let defaultConfig = {
6366 minimumShortsPerRow : 'auto' ,
6467 pauseChannelTrailers : true ,
6568 playerCompactPlayButton : true ,
66- playerHideFullScreenControls : false ,
6769 playerHideFullScreenTitle : false ,
6870 playerRemoveControlsBg : false ,
71+ playerRemoveDelhiExperimentFlags : false ,
6972 redirectLogoToSubscriptions : false ,
7073 searchThumbnailSize : 'medium' ,
7174 snapshotFormat : 'jpeg' ,
@@ -1489,6 +1492,35 @@ const configureCss = (() => {
14891492 }
14901493 }
14911494
1495+ if ( config . playerHideFullScreenMoreVideos ) {
1496+ if ( desktop ) {
1497+ hideCssSelectors . push ( '.ytp-fullscreen-grid' )
1498+ cssRules . push ( `
1499+ /* Prevent full screen from visually scrolling */
1500+ #movie_player {
1501+ --ytp-grid-scroll-percentage: 0 !important;
1502+ }
1503+ /* Prevent controls being hidden when full screen is scrolled */
1504+ .ytp-delhi-modern.ytp-fullscreen-grid-active .ytp-gradient-bottom {
1505+ display: none !important;
1506+ }
1507+ /* TODO Prevent bottom being hidden and fix its positioning */
1508+ ` )
1509+ }
1510+ if ( mobile ) {
1511+ hideCssSelectors . push ( '.fullscreen-watch-next-entrypoint-wrapper' )
1512+ }
1513+ }
1514+
1515+ if ( config . playerHideFullScreenControls ) {
1516+ if ( desktop ) {
1517+ hideCssSelectors . push ( '.ytp-fullscreen-quick-actions' )
1518+ }
1519+ if ( mobile ) {
1520+ hideCssSelectors . push ( 'player-fullscreen-action-menu' )
1521+ }
1522+ }
1523+
14921524 //#region Desktop-only
14931525 if ( desktop ) {
14941526 // Fix spaces & gaps caused by left gutter margin on first column items
@@ -1554,6 +1586,9 @@ const configureCss = (() => {
15541586 ` )
15551587 }
15561588 }
1589+ if ( config . hideChannelWatermark ) {
1590+ hideCssSelectors . push ( '.annotation.iv-branding' )
1591+ }
15571592 if ( config . hideChat ) {
15581593 hideCssSelectors . push (
15591594 // Live chat / Chat replay
@@ -1572,7 +1607,11 @@ const configureCss = (() => {
15721607 )
15731608 }
15741609 if ( config . hideEndCards ) {
1575- hideCssSelectors . push ( '#movie_player .ytp-ce-element' )
1610+ hideCssSelectors . push (
1611+ '#movie_player .ytp-ce-element' ,
1612+ // Hide YouTube's own new Hide button
1613+ '#movie_player .ytp-ce-hide-button-container' ,
1614+ )
15761615 }
15771616 if ( config . hideEndVideos ) {
15781617 hideCssSelectors . push (
@@ -1746,9 +1785,6 @@ const configureCss = (() => {
17461785 }
17471786 ` )
17481787 }
1749- if ( config . playerHideFullScreenControls ) {
1750- hideCssSelectors . push ( '.ytp-fullscreen-quick-actions' )
1751- }
17521788 if ( config . playerHideFullScreenTitle ) {
17531789 hideCssSelectors . push ( '.ytp-fullscreen-metadata' )
17541790 }
@@ -4051,6 +4087,19 @@ function main() {
40514087 } else {
40524088 configureCss ( )
40534089 triggerVideoPageResize ( )
4090+ if ( config . playerRemoveDelhiExperimentFlags ) {
4091+ // @ts -ignore
4092+ waitFor ( ( ) => window . yt , 'yt' ) . then ( ( ) => {
4093+ // @ts -ignore
4094+ let watchConfig = window . yt ?. config_ ?. WEB_PLAYER_CONTEXT_CONFIGS ?. WEB_PLAYER_CONTEXT_CONFIG_ID_KEVLAR_WATCH
4095+ if ( typeof watchConfig ?. serializedExperimentFlags == 'string' ) {
4096+ log ( 'playerDisableDelhiExperiments: removing delhi_modern_web_player experiment flags' )
4097+ watchConfig . serializedExperimentFlags = watchConfig . serializedExperimentFlags
4098+ . replace ( / & d e l h i _ m o d e r n _ w e b _ p l a y e r = t r u e / g, '' )
4099+ . replace ( / & d e l h i _ m o d e r n _ w e b _ p l a y e r _ i c o n s = t r u e / g, '' )
4100+ }
4101+ } )
4102+ }
40544103 }
40554104 observeTitle ( )
40564105 observePopups ( )
0 commit comments