YouTube Live Borderless

Make YouTube Live Borderless

安装为用户样式
作者推荐脚本

您可能也喜欢YouTube Video Resize Fix

安装此脚本
  1. /* ==UserStyle==
  2. @name YouTube Live Borderless
  3. @version 0.5.45
  4. @namespace github.com/cyfung1031
  5. @license MIT
  6. @description Make YouTube Live Borderless
  7. @author CY Fung
  8. @supportURL https://github.com/cyfung1031/YouTube-Live-Borderless/
  9. @compatible edge Edge [Blink] >= 105; Stylus (Beta)
  10. @compatible chrome Chrome >= 105; Stylus (Beta); Chrome 101-104 requires "enable-experimental-web-platform-features"
  11. @compatible firefox FireFox >= 103; Stylus; layout.css.has-selector.enabled = true; note: some features might not be very stable!!
  12. @compatible opera Opera >= 91; Stylus (Beta)
  13. @compatible safari Safari >= 15.4; Stylus
  14. @preprocessor stylus
  15. @var checkbox youtube-wpr "YouTube WPR" 0
  16. @var select mode-for-two-col "Mode ##TwoColumns" {
  17. "Expanded Panel Only #Recommended": "expanded-panel",
  18. "Expanded Live Chat Only": "expanded-live",
  19. "Expandable Live Chat Only": "expandable-live",
  20. "Always": "always"
  21. }
  22. @var select mode-for-single-col "Mode ##SingleColumn" {
  23. "YT Mobile #Recommended": "mobile",
  24. "Normal": "normal",
  25. "Disabled": "disabled"
  26. }
  27. @var checkbox no-masthead "Top.MastheadBar ::Hide" 0
  28. @var range masthead-hoverable-height "Top.MastheadBar ::Hoverable" [12, 0, 36, 2, 'px']
  29. @var range masthead-hoverable-delay-in "Top.MastheadBar ::Hoverable.DelayIn" [300, 0, 800, 100, 'ms']
  30. @var checkbox disable-cinematics "CinematicsEffect ::Disable" 0
  31. @var range video-enlarging "Video.Enlarging >>>Video.Border.Fine.Tune" [0, 0, 8, 2]
  32. @var range video-padding-left-right "Video.Padding.LeftRight (Experimental)" [0, 0, 18, 2, 'px']
  33. @var range video-padding-top-bottom "Video.Padding.TopBottom (Experimental)" [0, 0, 18, 2, 'px']
  34. @var range primary-content-margin "PrimaryContent ::Margin" [24, 6, 48, 6, "px"]
  35. @var range video-title-size "VideoTitle ::Size" [2.0, 1.0, 3.0, 0.2, "rem"]
  36. @var checkbox no-bottom-row "Bottom.PrimaryMetaInfoRow ::Hide" 0
  37. @var range min-below-area "BelowArea ::Minimum" [120, 0, 240, 10, 'px']
  38. @var range min-below-area-for-theater "WideTheater.BelowArea ::Minimum" [120, 0, 240, 10, 'px']
  39. @var checkbox fix-below-area-scroll "Bottom.FixScroll (without Tabview Youtube)" 1
  40. @var number side-panel-width "SidePanel ::Width" [440, 320, 640, 20, "px"]
  41. @var checkbox no-round-border "RoundBorder ::Disable" 1
  42. @var number chat-zoom-for-right-col "RightCol.Chat ::Zoom" [1.0, 0.4, 1.2, 0.05]
  43. @var range chat-btn-height "RightCol.Chat ::SpaceAbove@Zoom" [36, 0, 60, 4, 'px']
  44. @var number chat-zoom-for-mobile "YTMobile.Chat ::Zoom" [1.0, 0.4, 1.2, 0.05]
  45. @var range chat-min-height "YTMobile.Chat ::Min.Height" [400, 20, 900, 10, 'px']
  46. @var checkbox unlimit-player-max-width "Unlimit Player Max Width" 1
  47. @var checkbox fix-player-height-overflow-a "Fix Player Height Overflow (v1)" 0
  48. @var checkbox fix-player-height-overflow-b "Fix Player Height Overflow (v2)" 1
  49. @var checkbox video-no-round-angle "Video No Round Angle" 1
  50. @var checkbox compatible-ytlstm "Compatible with ytlstm-theater-mode" 0
  51. @var checkbox fix-for-ytlc "Fix for YouTubeLiveClock" 0
  52. @var checkbox show-comments-region "Show Comments (without Tabview Youtube)" 0
  53. ==/UserStyle== */
  54. /*
  55.  
  56. @var range chrome-bottom-bar-margin "Chrome Bottom Bar Margin" [12, 6, 48, 6, "px"]
  57.  
  58. Chrome Bottom Bar Margin is 12px only due to
  59.  
  60. MU = function(a) {
  61. var b = a.u.ag()
  62. , c = a.G.getVideoData().D
  63. , d = 0;
  64. a.u.ag() && a.u.Me() && (d = (a.G.fb().getPlayerSize().width - a.G.getVideoContentRect().width) / 2);
  65. return 12 * (c ? 0 : b ? 2 : 1) + d
  66. }
  67.  
  68. */
  69. // d
  70. @-moz-document url-prefix("https://www.youtube.com/watch?v="),
  71. url-prefix("https://www.youtube.com/live/") {
  72.  
  73. dummy() {
  74. // dummy
  75. border: 0;
  76. }
  77.  
  78. buildL4(type, args...) {
  79. st1 = join('', ':', type, '(', join('\, ', args), ')')
  80. selector(st1)
  81. }
  82.  
  83. /*
  84. if min-below-area <= 10px {
  85. min-below-area = 0px
  86. }
  87. if min-below-area-for-theater <= 10px {
  88. min-below-area-for-theater = 0px
  89. }
  90. */
  91. chat-btn-height = chat-btn-height + 1px
  92. if chat-btn-height == 0px + 1px {
  93. chat-btn-height = 0px
  94. }
  95.  
  96. // masthead-hoverable-height = (masthead-hoverable-h - 1) * 2px
  97.  
  98. no-masthead-w = no-masthead //
  99. chrome-bottom-bar-margin = 12px // this cannot be changed
  100.  
  101. single-col-mobile = (mode-for-single-col == "mobile" ? 1 : 0) //
  102. if single-col-mobile == 1 and no-masthead-w == 0 {
  103. no-masthead-w = 2 //
  104. }
  105.  
  106. chat-zoom-for-mobile-enable = ((chat-zoom-for-mobile < 1) or (chat-zoom-for-mobile > 1))
  107.  
  108. contentBase() {
  109. html {
  110. --ylb-min-below-area: min-below-area;
  111. }
  112. #microformat.ytd-watch-flexy {
  113. position: fixed;
  114. top:-200vh;
  115. left:-200vw;
  116. }
  117.  
  118. if fix-player-height-overflow-a { // 縦配信
  119. html:not([tabview-loaded]) {
  120. --yt-fix-player-contain: layout;
  121. }
  122. .efyt-mini-player {
  123. --yt-fix-player-contain: initial;
  124. }
  125. #player > #player-container-outer.style-scope.ytd-watch-flexy {
  126. contain: var(--yt-fix-player-contain);
  127. }
  128. }
  129.  
  130. if fix-player-height-overflow-b {
  131. #player.style-scope.ytd-watch-flexy {
  132. contain: layout;
  133. }
  134. }
  135.  
  136. if fix-for-ytlc {
  137.  
  138. @supports (color: var(--compatibile-with-chrome-plugin-youtube-live-clock-20221107)) {
  139.  
  140. /* 2022/11/07 - specific fix for YouTubeLiveClock - chrome only */
  141. html:has(style#ytlctn-style-for-native-control) #columns.ytd-watch-flexy #player::after {
  142. content: "";
  143. background-color: transparent;
  144. border-color: transparent;
  145. color: transparent;
  146. box-sizing: border-box;
  147. border-style: dotted;
  148. display: flex;
  149. height: 0px;
  150. margin: 0;
  151. border: 0;
  152. margin-top: 51px;
  153. width: calc(100% - 4px);
  154. position: relative;
  155. pointer-events: none;
  156. }
  157.  
  158. html:has(style#ytlctn-style-for-native-control) #columns.ytd-watch-flexy #below {
  159. transform: initial;
  160. }
  161.  
  162. html:has(style#ytlctn-style-for-native-control) ytd-watch-flexy[flexy][is-two-columns_][theater] #columns.ytd-watch-flexy {
  163. margin-top: 51px;
  164. }
  165. html:has(style#ytlctn-style-for-native-control) #columns {
  166. overflow: revert;
  167. }
  168. }
  169.  
  170. @supports (color: var(--compatibile-with-chrome-plugin-youtube-live-clock-20240123)) {
  171.  
  172. /* 2024/01/23 - specific fix for YouTubeLiveClock - chrome only */
  173. html:has(style#ytlc-style-for-native-control) #columns.ytd-watch-flexy #player::after {
  174. content: "";
  175. background-color: transparent;
  176. border-color: transparent;
  177. color: transparent;
  178. box-sizing: border-box;
  179. border-style: dotted;
  180. display: flex;
  181. height: 0px;
  182. margin: 0;
  183. border: 0;
  184. margin-top: 51px;
  185. width: calc(100% - 4px);
  186. position: relative;
  187. pointer-events: none;
  188. }
  189.  
  190. html:has(style#ytlc-style-for-native-control) #columns.ytd-watch-flexy #below {
  191. transform: initial;
  192. }
  193.  
  194. html:has(style#ytlc-style-for-native-control) ytd-watch-flexy[flexy][is-two-columns_][theater] #columns.ytd-watch-flexy {
  195. margin-top: 51px;
  196. }
  197. html:has(style#ytlc-style-for-native-control) #columns {
  198. overflow: revert;
  199. }
  200. }
  201.  
  202.  
  203.  
  204. }
  205.  
  206. ytd-watch-flexy[flexy] #player-container-outer.ytd-watch-flexy,
  207. ytd-watch-flexy[flexy] #player-container-inner.ytd-watch-flexy {
  208. pointer-events: none;
  209. }
  210.  
  211. ytd-watch-flexy[flexy] #player-container.ytd-watch-flexy,
  212. ytd-watch-flexy[flexy] #ytd-player.ytd-watch-flexy {
  213. pointer-events: initial;
  214. }
  215.  
  216. // general fix
  217. ytd-watch-flexy[theater] .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  218. min-height: unset;
  219. }
  220. #movie_player .ytp-cued-thumbnail-overlay-image {
  221. /* background-size: contain !important; */
  222. background-size: auto 100% !important;
  223. }
  224. ytd-watch-flexy:not([is-two-columns_]) ytd-watch-metadata {
  225. padding-top: var(--ytd-margin-3x);
  226. }
  227. ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]) #primary.ytd-watch-flexy {
  228. padding-top: 0;
  229. margin-top: 0;
  230. }
  231.  
  232. m = youtube-wpr ? ':not([tabview-loaded])[youtube-wpr*="h2"]' : ':not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)'
  233.  
  234. selector-comments-1 = show-comments-region ? '#primary-inner.ytd-watch-flexy ytd-commentsx#commentsx.ytd-watch-flexy' : '#primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy'
  235.  
  236. html{selector(m)} {buildL4('is',
  237. selector-comments-1,
  238. '#secondary-inner.ytd-watch-flexy > #related.ytd-watch-flexy')} {
  239. display: none !important;
  240. }
  241.  
  242.  
  243. html:not([tabview-loaded]) #cinematics {
  244. // contain: layout;
  245. contain: layout size style;
  246. user-select: none;
  247. touch-action: none;
  248. pointer-events: none;
  249. }
  250.  
  251. if video-no-round-angle {
  252. ytd-watch-flexy[rounded-player-large][default-layout] #ytd-player.ytd-watch-flexy.ytd-watch-flexy,
  253. ytd-watch-flexy[rounded-player][default-layout] #ytd-player.ytd-watch-flexy.ytd-watch-flexy {
  254. border-radius: 0;
  255. }
  256. }
  257.  
  258. }
  259.  
  260. //
  261. contentNoMasthead() {
  262.  
  263. // root = html
  264. & {
  265. /* 0px not 0 */
  266. --ytd-masthead-height: 0px;
  267. --ytd-toolbar-height: 0px;
  268. --ytd-watch-flexy-masthead-height: 0px;
  269. }
  270. ytd-app[style] { /* YouTube set the masthead-height in style */
  271. --ytd-masthead-height: 0px !important;
  272. --ytd-toolbar-height: 0px !important;
  273. --ytd-watch-flexy-masthead-height: 0px !important;
  274. }
  275. & .style-scope{buildL4('is', '#page-manager', 'ytd-watch-flexy', 'ytd-page-manager')} {
  276. --ytd-masthead-height: 0px;
  277. --ytd-toolbar-height: 0px;
  278. --ytd-watch-flexy-masthead-height: 0px;
  279. }
  280.  
  281. #masthead-container {
  282. height: 0;
  283. --masthead-opacity: 0;
  284. opacity: var(--masthead-opacity) !important;
  285. transition: opacity 300ms;
  286. min-height: masthead-hoverable-height;
  287. contain: layout size style;
  288. }
  289.  
  290. #masthead-container > ytd-masthead {
  291. transform: translateY(-100%);
  292. transition: transform 300ms;
  293. }
  294.  
  295.  
  296. if masthead-hoverable-height > 0 {
  297.  
  298. ytd-app {
  299. --ut-masthead-background: rgba(15,15,15,0.8);
  300. }
  301. ytd-app[darker-dark-theme] {
  302. --ut-masthead-background: rgba(240,240,240,0.8);
  303. }
  304. ytd-masthead#masthead:hover {
  305. background-color: color(--ut-masthead-background);
  306. z-index: 9999 !important;
  307. }
  308.  
  309. ytd-masthead#masthead {
  310. background-color: rgba(15,15,15,0.8);
  311. z-index: 9999 !important;
  312. }
  313.  
  314. #masthead-container:hover {
  315. --masthead-opacity: 1;
  316. }
  317.  
  318. #masthead-container:hover > ytd-masthead {
  319. transform: translateY(0%);
  320. transition-delay: masthead-hoverable-delay-in;
  321. }
  322.  
  323. #masthead-container::after {
  324. content: '';
  325. display: flex;
  326. width: 100%;
  327. height: masthead-hoverable-height;
  328. top: 0;
  329. z-index: 77;
  330. cursor: default;
  331. user-select: none !important;
  332. touch-action: none !important;
  333. box-sizing: border-box;
  334. padding: 0;
  335. margin: 0;
  336. }
  337. }
  338.  
  339. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]):not([theater]) {
  340.  
  341. #columns.style-scope.ytd-watch-flexy,
  342. #primary.style-scope.ytd-watch-flexy,
  343. #primary-inner.style-scope.ytd-watch-flexy,
  344. #secondary.style-scope.ytd-watch-flexy,
  345. #secondary-inner.style-scope.ytd-watch-flexy {
  346. height: 100vh;
  347. max-height: 100%;
  348. }
  349.  
  350. if fix-below-area-scroll {
  351.  
  352. #primary-inner.style-scope.ytd-watch-flexy {
  353. display: flex;
  354. flex-direction: column;
  355. }
  356.  
  357. #primary-inner.style-scope.ytd-watch-flexy > [id] {
  358. flex-shrink: 0;
  359. }
  360.  
  361. #primary-inner.style-scope.ytd-watch-flexy > #below.style-scope.ytd-watch-flexy:last-child {
  362. flex-grow: 1;
  363. flex-shrink: 0;
  364. contain: size;
  365. overflow: auto;
  366. height: auto;
  367. }
  368. }
  369.  
  370. }
  371.  
  372. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  373.  
  374. height: 100vh;
  375. .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  376. flex: 77;
  377. max-height: unset;
  378. }
  379.  
  380.  
  381. }
  382.  
  383.  
  384.  
  385. &:not([tabview-loaded]) ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) {
  386.  
  387. .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} ~ #columns.style-scope.ytd-watch-flexy {
  388. overflow: visible;
  389. }
  390. }
  391.  
  392.  
  393. } //
  394. contentSingleColMobile() {
  395.  
  396. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))
  397.  
  398. if no-masthead-w>=1 {
  399.  
  400.  
  401. if youtube-wpr {
  402.  
  403.  
  404. &[youtube-wpr*="h2"] ytd-watch-flexy:not([theater]):not([fullscreen]):not([no-top-margin]):not([reduced-top-margin]) .ytd-watch-flexy{buildL4('is', '#primary', '#secondary')} {
  405. padding-top: 0px;
  406. }
  407. &[youtube-wpr*="h2"] ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  408. padding-bottom: 0px;
  409. }
  410.  
  411.  
  412. } else {
  413.  
  414.  
  415. &:has(#chat:not([collapsed])) ytd-watch-flexy:not([theater]):not([fullscreen]):not([no-top-margin]):not([reduced-top-margin]) .ytd-watch-flexy{buildL4('is', '#primary', '#secondary')} {
  416. padding-top: 0px;
  417. }
  418. &:has(#chat:not([collapsed])) ytd-watch-flexy[tyt-tab^="#tab-"]:not([is-two-columns_]) #primary-inner.ytd-watch-flexy {
  419. padding-bottom: 0px;
  420. }
  421.  
  422. }
  423.  
  424. }
  425.  
  426. #chat:not([collapsed]) {
  427. --ytd-margin-2x: 0px;
  428. --ytd-margin-3x: 0px;
  429. --ytd-margin-4x: 0px;
  430. --ytd-margin-6x: 0px;
  431. --ytd-margin-8x: 0px;
  432.  
  433. height: 100% !important;
  434. min-height: unset !important;
  435. max-height: 100vh !important;
  436.  
  437. // position:relative;
  438. // top:auto;
  439. // bottom:0;
  440.  
  441. iframe#chatframe{
  442.  
  443. min-height: 0px;
  444.  
  445. }
  446.  
  447.  
  448.  
  449. if chat-zoom-for-mobile-enable {
  450.  
  451.  
  452. iframe-transform = 'scale(%s)' % chat-zoom-for-mobile
  453. iframe-ratio = 100% / chat-zoom-for-mobile
  454.  
  455. iframe#chatframe {
  456. position:absolute;
  457.  
  458. transform: iframe-transform;
  459. height: s('calc((100% - %s) / %s) !important', chat-btn-height, chat-zoom-for-mobile);
  460. max-height: unset !important;
  461. min-height: unset !important;
  462. transform-origin: 0 0;
  463. width: iframe-ratio !important;
  464. margin-top: chat-btn-height;
  465.  
  466.  
  467. }
  468.  
  469.  
  470. }
  471.  
  472.  
  473. }
  474.  
  475.  
  476. m = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  477. selector-comments-2 = show-comments-region ? '#primary-inner.ytd-watch-flexy ytd-commentsx#commentsx.ytd-watch-flexy' : '#primary-inner.ytd-watch-flexy ytd-comments#comments.ytd-watch-flexy'
  478.  
  479. &{selector(m)} {
  480. // html:has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen])):has(#chat:not([collapsed]))
  481.  
  482. --ylb-min-below-area: chat-min-height;
  483.  
  484. #contentContainer.tp-yt-app-drawer[swipe-open].tp-yt-app-drawer::after {
  485.  
  486. content: unset;
  487.  
  488. }
  489.  
  490. {selector-comments-2},
  491. #below.ytd-watch-flexy > .ytd-watch-flexy{buildL4('is', '#related', 'ytd-watch-metadata')} {
  492. /* display:none !important; */
  493. position: fixed !important;
  494. transform: scale(0.01) !important;
  495. transform-origin: 0 0 !important;
  496. left: -100vw !important;
  497. top: -100vh !important;
  498. visibility: collaspe !important;
  499. pointer-events: none !important;
  500. user-select: none !important;
  501. touch-action: none !important;
  502. }
  503.  
  504. #secondary.ytd-watch-flexy {
  505. display:none !important;
  506. }
  507.  
  508.  
  509. .efyt-control-bar {
  510. position: relative;
  511. display: inline-flex;
  512. top: auto;
  513. left: auto;
  514. z-index: 99999;
  515. opacity: 0.8;
  516. transform: translate(calc(-100% + 32px), 0) !important;
  517. }
  518.  
  519. .efyt-control-bar:hover {
  520. opacity: 1.0;
  521. background: var(--yt-spec-general-background-a);
  522. transform: translate(0px, 0) !important;
  523. }
  524.  
  525. #player {
  526. margin-bottom: 0;
  527. }
  528.  
  529. {buildL4('is', '#columns', '#primary')} {
  530. padding: 0;
  531. }
  532.  
  533. {buildL4('is', '#player', '#player-theater-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  534. object-fit: contain;
  535. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  536.  
  537. }
  538.  
  539. #primary-inner.ytd-watch-flexy > :not(.style-scope) {
  540. display: none !important;
  541. }
  542.  
  543. #below {
  544. display: flex;
  545. flex-direction: column;
  546. flex: 1;
  547. }
  548. #below > *:not([id|="chat"]) {
  549. position: fixed !important;
  550. transform: scale(0.01) !important;
  551. transform-origin: 0 0 !important;
  552. left: -100vw !important;
  553. top: -100vh !important;
  554. visibility: collaspe !important;
  555. pointer-events: none !important;
  556. user-select: none !important;
  557. touch-action: none !important;
  558. }
  559. #below ~ [id|="chat"],
  560. #primary-inner.ytd-watch-flexy ~ [id|="chat"],
  561. #primary.ytd-watch-flexy ~ [id|="chat"] {
  562. flex: 1;
  563. }
  564.  
  565. #below:not(:has(#chat)) {
  566. display: none;
  567. }
  568.  
  569. {buildL4('is', 'ytd-watch-flexy', '#columns.ytd-watch-flexy', '#primary.ytd-watch-flexy', '#primary-inner.ytd-watch-flexy')} {
  570. display: flex;
  571. flex-direction: column;
  572. margin: 0;
  573. flex: 1;
  574. }
  575.  
  576. ytd-watch-flexy {
  577. height: 100vh !important;
  578. max-height: 100vh !important;
  579. }
  580.  
  581. ytd-watch-flexy{buildL4('is', '[theater]', '[fullscreen]')} .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  582.  
  583. min-height: unset !important;
  584. }
  585. }
  586. }
  587. content2cHTML() {
  588. // html
  589. body.lock-scrollbar {
  590. overflow-y: auto;
  591. }
  592. }
  593.  
  594. content2cMAIN() {
  595. // body or html
  596.  
  597. if chat-zoom-for-right-col > 1 or chat-zoom-for-right-col < 1 {
  598.  
  599. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) iframe#chatframe {
  600.  
  601. position:absolute;
  602. margin-top:chat-btn-height;
  603.  
  604. transform: 'scale(%s)' % chat-zoom-for-right-col;
  605. transform-origin: 0 0;
  606. width: '%s !important' % (100% / chat-zoom-for-right-col);
  607. max-width: unset !important;
  608. height: s('calc( (100% - %s) / %s ) !important', chat-btn-height, chat-zoom-for-right-col);
  609. z-index: 1; /* for normal youtube */
  610.  
  611. }
  612.  
  613. }
  614.  
  615.  
  616. if no-masthead-w==0 {
  617.  
  618. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) {
  619.  
  620. .style-scope.ytd-watch-flexy{buildL4('is', '#secondary', '#secondary-inner')} {
  621. height: calc(100vh - var(--ytd-toolbar-height));
  622. max-height: 100%;
  623. }
  624. }
  625. }
  626.  
  627.  
  628. ytd-watch-flexy[is-two-columns_]:not([fullscreen]) #movie_player {
  629.  
  630. .ytp-chrome-bottom[style*="width"] {
  631. width: unset !important;
  632. left: chrome-bottom-bar-margin !important;
  633. right: chrome-bottom-bar-margin !important;
  634. }
  635.  
  636. }
  637.  
  638.  
  639. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) ytd-live-chat-frame#chat:not([collapsed]) {
  640. min-height: unset;
  641. }
  642.  
  643.  
  644.  
  645. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]) #primary-inner.ytd-watch-flexy > *:not(#player) {
  646. padding: 0 primary-content-margin 0;
  647. }
  648.  
  649.  
  650. ytd-watch-flexy.style-scope[is-two-columns_]:not([theater]):not([fullscreen]) #player .ytd-watch-flexy{buildL4('is', '#player-container-outer', '#player-container-inner', '#player-container')}{
  651.  
  652. // layout outside
  653. // no effect
  654. // layout inside
  655. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for very wide screen
  656. }
  657.  
  658. ytd-watch-flexy.style-scope[is-two-columns_][theater]:not([fullscreen]) .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  659. max-height: calc(100vh - var(--ytd-toolbar-height, 0px) - var(--ylb-min-below-area, 0px)); // for 4:3 video
  660.  
  661. }
  662.  
  663. ytd-watch-flexy.style-scope[is-two-columns_] #columns.ytd-watch-flexy > #secondary.ytd-watch-flexy {
  664. width: side-panel-width;
  665. }
  666. if unlimit-player-max-width {
  667. ytd-watch-flexy.style-scope, ytd-watch-flexy.style-scope > * {
  668. --ytd-watch-flexy-sidebar-width: side-panel-width;
  669. --ytd-watch-flexy-max-player-width-wide-screen: calc(100vw - var(--ytd-watch-flexy-sidebar-width));
  670. --ytd-watch-flexy-max-player-width: calc(100vw - var(--ytd-watch-flexy-sidebar-width));
  671. }
  672. }
  673. }
  674. contentfHTML(){
  675. // html
  676.  
  677. body ytd-watch-flexy[flexy] #player-container-outer.ytd-watch-flexy {
  678. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  679. }
  680.  
  681. &:not([tabview-loaded]) {
  682.  
  683. body ytd-watch-flexy[flexy][is-two-columns_]{buildL4('is', '[is-extra-wide-video_]', '[is-four-three-to-sixteen-nine-video_]')} #primary.ytd-watch-flexy {
  684.  
  685. max-width: unset; // override var(--ytd-watch-flexy-max-player-width);
  686.  
  687. }
  688. }
  689. chat-selector = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  690.  
  691. &{selector(chat-selector)} {
  692. ytd-watch-flexy.style-scope:not([fullscreen]) {
  693. .style-scope{buildL4('is', '#chat', '#chat-container')}{
  694. flex: 77;
  695. }
  696. }
  697. }
  698. }
  699.  
  700. contentfMAIN() {
  701. // body or html
  702.  
  703. #lyricscontainer {
  704. --ygl-container-right: 0px;
  705. --ytd-margin-2x: 0px;
  706. --ytd-margin-3x: 0px;
  707. --ytd-margin-4x: 0px;
  708. --ytd-margin-6x: 0px;
  709. --ytd-margin-8x: 0px;
  710. }
  711.  
  712. if (video-padding-left-right + video-padding-top-bottom) > 0 {
  713.  
  714. #player-container-outer.ytd-watch-flexy {
  715. padding-left: video-padding-left-right;
  716. padding-right: video-padding-left-right;
  717. padding-top: video-padding-top-bottom;
  718. padding-bottom: video-padding-top-bottom;
  719. }
  720.  
  721. }
  722.  
  723.  
  724. &:not([tabview-loaded]) {
  725.  
  726. ytd-watch-flexy:not([fullscreen]) .ytd-watch-flexy{buildL4('is', '#player-theater-container', '#player-wide-container')} {
  727. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  728. }
  729.  
  730.  
  731. ytd-watch-flexy[is-two-columns_]:not([theater]):not([fullscreen]) {buildL4('is', '#columns', '#primary', '#primary-inner', '#secondary', '#secondary-inner')} {
  732. height: calc(100vh - var(--ytd-toolbar-height));
  733. }
  734.  
  735. }
  736.  
  737. if video-enlarging > 0 {
  738.  
  739. ytd-watch-flexy:not([theater]):not([fullscreen]) #movie_player video[src] {
  740. transform: 'scale(%s)' % (video-enlarging / 1000 + 1) ;
  741. transform-origin: 50% 50%;
  742. }
  743.  
  744. }
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752. ytd-watch-flexy[flexy][is-two-columns_][theater]:not([fullscreen]) {
  753.  
  754. --ylb-min-below-area: min-below-area-for-theater;
  755.  
  756. {buildL4('is', '#player', '#player-theater-container', '#player-wide-container', '#player-container-outer', '#player-container-inner', '#player-container', '#movie_player', '#movie_player video')} {
  757. object-fit: contain;
  758. max-height: calc(100vh - var(--ytd-toolbar-height) - var(--ylb-min-below-area, 0px)) !important;
  759. }
  760. }
  761.  
  762.  
  763.  
  764. if no-bottom-row {
  765.  
  766. #bottom-row.ytd-watch-metadata {
  767. display: none !important;
  768. }
  769. }
  770.  
  771. h1.ytd-watch-metadata {
  772. font-size: video-title-size;
  773. --font-size: video-title-size;
  774. line-height: 140%;
  775. margin-bottom: -2px;
  776. }
  777.  
  778. chat-selector = youtube-wpr ? '[youtube-wpr*="h2"]': ":has(#chat:not([collapsed]))"
  779. #secondary-inner.ytd-watch-flexy {
  780. --tabview-slider-right: 0px !important;
  781. }
  782.  
  783. ytd-watch-flexy.style-scope:not([fullscreen]) {
  784.  
  785. & {
  786. --ytd-margin-2y: var(--ytd-margin-2x);
  787. --ytd-margin-3y: var(--ytd-margin-3x);
  788. --ytd-margin-4y: var(--ytd-margin-4x);
  789. --ytd-margin-6y: var(--ytd-margin-6x);
  790. --ytd-margin-8y: var(--ytd-margin-8x);
  791. }
  792.  
  793. #columns.style-scope.ytd-watch-flexy {
  794. --ytd-margin-2x: 0px;
  795. --ytd-margin-3x: 0px;
  796. --ytd-margin-4x: 0px;
  797. --ytd-margin-6x: 0px;
  798. --ytd-margin-8x: 0px;
  799. }
  800.  
  801. .style-scope.ytd-watch-flexy > :not(.ytd-watch-flexy):not(secondary-wrapper),
  802. .style-scope.ytd-watch-flexy > secondary-wrapper > :not(.ytd-watch-flexy),
  803. #below,
  804. #player {
  805. --ytd-margin-2x: var(--ytd-margin-2y);
  806. --ytd-margin-3x: var(--ytd-margin-3y);
  807. --ytd-margin-4x: var(--ytd-margin-4y);
  808. --ytd-margin-6x: var(--ytd-margin-6y);
  809. --ytd-margin-8x: var(--ytd-margin-8y);
  810. }
  811. if unlimit-player-max-width {
  812. &.style-scope[class][flexy]:not([attr1][attr2]) #columns.ytd-watch-flexy.style-scope[class] {
  813. max-width: initial;
  814. }
  815. #columns {
  816. --ytd-watch-flexy-max-player-width: initial;
  817. --ytd-watch-flexy-max-player-width-wide-screen: initial;
  818. }
  819. }
  820.  
  821. #secondary-inner.style-scope.ytd-watch-flexy {
  822. display: flex;
  823. flex-direction: column;
  824. height: 100%;
  825. }
  826.  
  827. #secondary-inner.style-scope.ytd-watch-flexy > * {
  828. flex-shrink: 0;
  829. }
  830.  
  831. #movie_player {
  832. position: relative;
  833. > .html5-video-container:has(video) {
  834. top: 0;
  835. bottom: 0;
  836. left: 0;
  837. right: 0;
  838. position: absolute;
  839. }
  840.  
  841. .html5-video-container > video {
  842. width: unset !important;
  843. height: 100% !important;
  844. left: 0 !important;
  845. right: 0 !important;
  846. max-height: 100%;
  847. max-width: 100%;
  848. margin: 0 auto;
  849. }
  850.  
  851. .html5-video-container > video[style*="top:"]:not(video[style*="top: -"]):not(video[style*="top:-"]) {
  852. top: 0 !important;
  853. }
  854.  
  855. }
  856.  
  857. #chat-container {
  858. display: flex;
  859. flex-direction: column;
  860. }
  861.  
  862. #right-tabs {
  863. display: flex;
  864. margin: 0 !important;
  865. flex: 1;
  866. flex-direction: column;
  867.  
  868. {buildL4('is', '#material-tabs', '.tab-content')} {
  869. outline: 0;
  870. }
  871.  
  872. .tab-content {
  873. flex: 77;
  874. }
  875. }
  876.  
  877. &[tyt-tab=""] #right-tabs {
  878. flex: 0;
  879. }
  880.  
  881. &:not([is-two-columns_]) #primary-inner > *:not(#player) {
  882. padding: 0;
  883. }
  884.  
  885. &:not([is-two-columns_]) #primary-inner #below > *:not([id|="chat"]) {
  886. padding: 0 primary-content-margin 0;
  887. }
  888.  
  889. }
  890.  
  891. if no-round-border {
  892.  
  893. ytd-watch-flexy.style-scope[is-two-columns_]:not([fullscreen]):not([theater]) {
  894.  
  895. ytd-live-chat-frame[rounded-container],
  896. ytd-live-chat-frame[rounded-container] iframe.ytd-live-chat-frame,
  897. &[tyt-tab] #right-tabs #material-tabs,
  898. &[tyt-tab] #right-tabs .tab-content,
  899. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame,
  900. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame button.yt-spec-button-shape-next,
  901. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame button.yt-spec-button-shape-next:hover,
  902. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame button
  903. {
  904. border-radius: unset;
  905. }
  906.  
  907. ytd-live-chat-frame #show-hide-button.ytd-live-chat-frame > ytd-button-renderer.style-scope.ytd-live-chat-frame{
  908. margin: 0;
  909. }
  910.  
  911. }
  912.  
  913. }
  914.  
  915.  
  916. if disable-cinematics {
  917. #cinematics.ytd-watch-flexy {
  918. display: none;
  919. }
  920. }
  921. } //
  922. contentgHTML() {
  923. // html
  924.  
  925. content2cHTML() //
  926. selector-g = '' //
  927. if mode-for-single-col=="disabled" { //
  928. selector-g = youtube-wpr ? '[youtube-wpr*="s"]': ":has(ytd-watch-flexy[is-two-columns_])" //
  929. } //
  930. &{s(selector-g)} { //
  931. // html
  932. contentfHTML() //
  933. } //
  934. }
  935. contentgMAIN() {
  936. // body or html
  937.  
  938. content2cMAIN() //
  939. selector-g = '' //
  940. if mode-for-single-col=="disabled" { //
  941. selector-g = youtube-wpr ? '[youtube-wpr*="s"]': ":has(ytd-watch-flexy[is-two-columns_])" //
  942. } //
  943. &{s(selector-g)} { //
  944. // html
  945. contentfMAIN() //
  946. } //
  947. }
  948. contentBase() //
  949. selectors-2col = { //
  950. "expanded-panel": join(', ',
  951. "html:not([tabview-loaded]):has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  952. "html[tabview-loaded]:has(ytd-watch-flexy[is-two-columns_]:not([fullscreen]))"
  953. ),
  954. "expanded-live": "html:has(ytd-live-chat-frame#chat:not([collapsed])):has(iframe#chatframe)",
  955. "expandable-live": "html:has(ytd-live-chat-frame#chat):has(iframe#chatframe)",
  956. "always": "html"
  957. } //
  958. if youtube-wpr {
  959. selectors-2col = { //
  960. "expanded-panel": join(', ',
  961. 'html:not([tabview-loaded])[youtube-wpr*="h2"][youtube-wpr*="f"]',
  962. 'html[tabview-loaded][youtube-wpr*="s"][youtube-wpr*="f"]'
  963. ),
  964. "expanded-live": 'html[youtube-wpr*="h2"][youtube-wpr*="f"]',
  965. "expandable-live": 'html:not([youtube-wpr*="h0"])[youtube-wpr*="f"]',
  966. "always": 'html[youtube-wpr*="f"]'
  967. } //
  968. }
  969. selector-2col = selectors-2col[mode-for-two-col]
  970. selectors-k = split(', ', selector-2col)
  971. for selector-k in selectors-k {
  972. {s(selector-k)} {
  973. if no-masthead-w==1 {
  974. contentNoMasthead()
  975. }
  976. if compatible-ytlstm {
  977. contentgHTML()
  978. body:not([data-ytlstm-theater-mode]) {
  979. contentgMAIN() //
  980. }
  981. } else {
  982. contentgHTML()
  983. contentgMAIN() //
  984. }
  985. }
  986. }
  987.  
  988. if single-col-mobile {
  989. m = youtube-wpr ? '[youtube-wpr*="S"][youtube-wpr*="f"]': ":has(ytd-watch-flexy:not([is-two-columns_]):not([fullscreen]))"
  990. html{selector(m)} {
  991.  
  992. if no-masthead-w==1 {
  993. contentNoMasthead()
  994. }
  995. if no-masthead-w==2 {
  996. if youtube-wpr {
  997. &[youtube-wpr*="h2"] {
  998. contentNoMasthead()
  999. }
  1000. } else {
  1001. &:has(#chat:not([collapsed])) {
  1002. contentNoMasthead()
  1003. }
  1004. }
  1005. }
  1006. contentSingleColMobile()
  1007. }
  1008. }
  1009.  
  1010. @css {
  1011.  
  1012. @supports not selector(:has(body)) {
  1013.  
  1014.  
  1015. html::after {
  1016. display: block;
  1017. content: 'Your browser does not support "has-selector". Please update to latest version and enable it via configuration.';
  1018. width: 60vh;
  1019. padding: 12px;
  1020. height: auto;
  1021. position: fixed;
  1022. left: 50%;
  1023. top: 50%;
  1024. transform: translate(-50%, -50%);
  1025. transform-origin: 0 0;
  1026. background: #71210f;
  1027. color: #d2dadb;
  1028. font-size: 14pt;
  1029. text-shadow: 1px 1px 2px #605262;
  1030. }
  1031.  
  1032. }
  1033. }
  1034.  
  1035.  
  1036. if youtube-wpr {
  1037.  
  1038. @css {
  1039. @supports selector(:has(body)) {
  1040.  
  1041. @keyframes wpr-message-appear {
  1042. 0% {
  1043. top: -300vh;
  1044. }
  1045. 1% {
  1046. top: 50%;
  1047. }
  1048. 100% {
  1049. top: 50%;
  1050. }
  1051. }
  1052. html:not([youtube-wpr]) ytd-watch-flexy::after {
  1053. display: block;
  1054. content: 'YouTube Live Borderless: YouTube WPR is not yet installed. Please install the userscript https://greasyfork.org/scripts/457319 in order to use YouTube WPR';
  1055. width: 60vh;
  1056. padding: 12px;
  1057. height: auto;
  1058. position: fixed;
  1059. left: 50%;
  1060. top: -300vh;
  1061. transform: translate(-50%, -50%);
  1062. transform-origin: 0 0;
  1063. background: #71210f;
  1064. color: #d2dadb;
  1065. font-size: 14pt;
  1066. text-shadow: 1px 1px 2px #605262;
  1067. animation: wpr-message-appear 1ms 2s forwards;
  1068. z-index: 9999;
  1069. }
  1070. }
  1071.  
  1072. }
  1073.  
  1074. }
  1075. }