YouTube - Non-Rounded Design

This script disables YouTube's new rounded corners (reverts back to the previous layout before 2022 with extra stuff included such as the Explore tab, Auto redirect Shorts to watch interface, old Comment replies UI, etc...)

当前为 2023-05-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube - Non-Rounded Design
  3. // @version 3.7.4
  4. // @description This script disables YouTube's new rounded corners (reverts back to the previous layout before 2022 with extra stuff included such as the Explore tab, Auto redirect Shorts to watch interface, old Comment replies UI, etc...)
  5. // @author Magma_Craft
  6. // @license MIT
  7. // @match https://www.youtube.com/*
  8. // @namespace https://gf.qytechs.cn/en/users/933798
  9. // @icon https://www.youtube.com/favicon.ico
  10. // @run-at document-start
  11. // @grant none
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/arrive/2.4.1/arrive.min.js
  13. // ==/UserScript==
  14.  
  15. // Attributes to remove from <html>
  16. const ATTRS = [
  17. "darker-dark-theme",
  18. "darker-dark-theme-deprecate"
  19. ];
  20.  
  21. // Regular config keys.
  22. const CONFIGS = {
  23. BUTTON_REWORK: false
  24. }
  25.  
  26. // Experiment flags.
  27. const EXPFLAGS = {
  28. polymer_verifiy_app_state: false,
  29. enable_header_channel_handler_ui: false,
  30. kevlar_unavailable_video_error_ui_client: false,
  31. kevlar_refresh_on_theme_change: false,
  32. kevlar_watch_cinematics: false,
  33. kevlar_watch_metadata_refresh: false,
  34. kevlar_watch_modern_metapanel: false,
  35. web_amsterdam_playlists: false,
  36. web_animated_like: false,
  37. web_button_rework: false,
  38. web_button_rework_with_live: false,
  39. web_darker_dark_theme: false,
  40. web_guide_ui_refresh: false,
  41. web_modern_ads: false,
  42. web_modern_buttons: false,
  43. web_modern_chips: false,
  44. web_modern_dialogs: false,
  45. web_modern_playlists: false,
  46. web_rounded_containers: false,
  47. web_rounded_thumbnails: false,
  48. web_searchbar_style: "default",
  49. web_segmented_like_dislike_button: false,
  50. web_sheets_ui_refresh: false,
  51. web_snackbar_ui_refresh: false
  52. }
  53.  
  54. // Player flags
  55. // !!! USE STRINGS FOR VALUES !!!
  56. // For example: "true" instead of true
  57. const PLYRFLAGS = {
  58. web_rounded_containers: "false",
  59. web_rounded_thumbnails: "false"
  60. }
  61.  
  62. class YTP {
  63. static observer = new MutationObserver(this.onNewScript);
  64.  
  65. static _config = {};
  66.  
  67. static isObject(item) {
  68. return (item && typeof item === "object" && !Array.isArray(item));
  69. }
  70.  
  71. static mergeDeep(target, ...sources) {
  72. if (!sources.length) return target;
  73. const source = sources.shift();
  74.  
  75. if (this.isObject(target) && this.isObject(source)) {
  76. for (const key in source) {
  77. if (this.isObject(source[key])) {
  78. if (!target[key]) Object.assign(target, { [key]: {} });
  79. this.mergeDeep(target[key], source[key]);
  80. } else {
  81. Object.assign(target, { [key]: source[key] });
  82. }
  83. }
  84. }
  85.  
  86. return this.mergeDeep(target, ...sources);
  87. }
  88.  
  89.  
  90. static onNewScript(mutations) {
  91. for (var mut of mutations) {
  92. for (var node of mut.addedNodes) {
  93. YTP.bruteforce();
  94. }
  95. }
  96. }
  97.  
  98. static start() {
  99. this.observer.observe(document, {childList: true, subtree: true});
  100. }
  101.  
  102. static stop() {
  103. this.observer.disconnect();
  104. }
  105.  
  106. static bruteforce() {
  107. if (!window.yt) return;
  108. if (!window.yt.config_) return;
  109.  
  110. this.mergeDeep(window.yt.config_, this._config);
  111. }
  112.  
  113. static setCfg(name, value) {
  114. this._config[name] = value;
  115. }
  116.  
  117. static setCfgMulti(configs) {
  118. this.mergeDeep(this._config, configs);
  119. }
  120.  
  121. static setExp(name, value) {
  122. if (!("EXPERIMENT_FLAGS" in this._config)) this._config.EXPERIMENT_FLAGS = {};
  123.  
  124. this._config.EXPERIMENT_FLAGS[name] = value;
  125. }
  126.  
  127. static setExpMulti(exps) {
  128. if (!("EXPERIMENT_FLAGS" in this._config)) this._config.EXPERIMENT_FLAGS = {};
  129.  
  130. this.mergeDeep(this._config.EXPERIMENT_FLAGS, exps);
  131. }
  132.  
  133. static decodePlyrFlags(flags) {
  134. var obj = {},
  135. dflags = flags.split("&");
  136.  
  137. for (var i = 0; i < dflags.length; i++) {
  138. var dflag = dflags[i].split("=");
  139. obj[dflag[0]] = dflag[1];
  140. }
  141.  
  142. return obj;
  143. }
  144.  
  145. static encodePlyrFlags(flags) {
  146. var keys = Object.keys(flags),
  147. response = "";
  148.  
  149. for (var i = 0; i < keys.length; i++) {
  150. if (i > 0) {
  151. response += "&";
  152. }
  153. response += keys[i] + "=" + flags[keys[i]];
  154. }
  155.  
  156. return response;
  157. }
  158.  
  159. static setPlyrFlags(flags) {
  160. if (!window.yt) return;
  161. if (!window.yt.config_) return;
  162. if (!window.yt.config_.WEB_PLAYER_CONTEXT_CONFIGS) return;
  163. var conCfgs = window.yt.config_.WEB_PLAYER_CONTEXT_CONFIGS;
  164. if (!("WEB_PLAYER_CONTEXT_CONFIGS" in this._config)) this._config.WEB_PLAYER_CONTEXT_CONFIGS = {};
  165.  
  166. for (var cfg in conCfgs) {
  167. var dflags = this.decodePlyrFlags(conCfgs[cfg].serializedExperimentFlags);
  168. this.mergeDeep(dflags, flags);
  169. this._config.WEB_PLAYER_CONTEXT_CONFIGS[cfg] = {
  170. serializedExperimentFlags: this.encodePlyrFlags(dflags)
  171. }
  172. }
  173. }
  174. }
  175.  
  176. window.addEventListener("yt-page-data-updated", function tmp() {
  177. YTP.stop();
  178. for (i = 0; i < ATTRS.length; i++) {
  179. document.getElementsByTagName("html")[0].removeAttribute(ATTRS[i]);
  180. }
  181. window.removeEventListener("yt-page-date-updated", tmp);
  182. });
  183.  
  184. YTP.start();
  185.  
  186. YTP.setCfgMulti(CONFIGS);
  187. YTP.setExpMulti(EXPFLAGS);
  188. YTP.setPlyrFlags(PLYRFLAGS);
  189.  
  190. function $(q) {
  191. return document.querySelector(q);
  192. }
  193.  
  194. // Re-add 'Explore' tab in sidebar (it also replaces the 'Shorts' tab)
  195. function waitForElm(selector) {
  196. return new Promise(resolve => {
  197. if (document.querySelector(selector)) {
  198. return resolve(document.querySelector(selector));
  199. }
  200.  
  201. const observer = new MutationObserver(mutations => {
  202. if (document.querySelector(selector)) {
  203. resolve(document.querySelector(selector));
  204. observer.disconnect();
  205. }
  206. });
  207.  
  208. observer.observe(document.body, {
  209. childList: true,
  210. subtree: true
  211. });
  212. });
  213. }
  214.  
  215. function restoreTrending() {
  216.  
  217. var trendingData = {
  218. "navigationEndpoint": {
  219. "clickTrackingParams": "CBwQtSwYASITCNqYh-qO_fACFcoRrQYdP44D9Q==",
  220. "commandMetadata": {
  221. "webCommandMetadata": {
  222. "url": "/feed/explore",
  223. "webPageType": "WEB_PAGE_TYPE_BROWSE",
  224. "rootVe": 6827,
  225. "apiUrl": "/youtubei/v1/browse"
  226. }
  227. },
  228. "browseEndpoint": {
  229. "browseId": "FEtrending"
  230. }
  231. },
  232. "icon": {
  233. "iconType": "EXPLORE"
  234. },
  235. "trackingParams": "CBwQtSwYASITCNqYh-qO_fACFcoRrQYdP44D9Q==",
  236. "formattedTitle": {
  237. "simpleText": "Explore"
  238. },
  239. "accessibility": {
  240. "accessibilityData": {
  241. "label": "Explore"
  242. }
  243. },
  244. "isPrimary": true
  245. };
  246.  
  247. var guidetemplate = `<ytd-guide-entry-renderer class="style-scope ytd-guide-section-renderer" is-primary="" line-end-style="none"><!--css-build:shady--><a id="endpoint" class="yt-simple-endpoint style-scope ytd-guide-entry-renderer" tabindex="-1" role="tablist"><tp-yt-paper-item role="tab" class="style-scope ytd-guide-entry-renderer" tabindex="0" aria-disabled="false"><!--css-build:shady--><yt-icon class="guide-icon style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><yt-img-shadow height="24" width="24" class="style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-img-shadow><yt-formatted-string class="title style-scope ytd-guide-entry-renderer"><!--css-build:shady--></yt-formatted-string><span class="guide-entry-count style-scope ytd-guide-entry-renderer"></span><yt-icon class="guide-entry-badge style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><div id="newness-dot" class="style-scope ytd-guide-entry-renderer"></div></tp-yt-paper-item></a><yt-interaction class="style-scope ytd-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction></ytd-guide-entry-renderer>`;
  248. document.querySelector(`#items > ytd-guide-entry-renderer:nth-child(2)`).data = trendingData;
  249. var miniguidetemplate = `<ytd-mini-guide-entry-renderer class="style-scope ytd-mini-guide-section-renderer" is-primary="" line-end-style="none"><!--css-build:shady--><a id="endpoint" class="yt-simple-endpoint style-scope ytd-guide-entry-renderer" tabindex="-1" role="tablist"><tp-yt-paper-item role="tab" class="style-scope ytd-guide-entry-renderer" tabindex="0" aria-disabled="false"><!--css-build:shady--><yt-icon class="guide-icon style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><yt-img-shadow height="24" width="24" class="style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-img-shadow><yt-formatted-string class="title style-scope ytd-guide-entry-renderer"><!--css-build:shady--></yt-formatted-string><span class="guide-entry-count style-scope ytd-guide-entry-renderer"></span><yt-icon class="guide-entry-badge style-scope ytd-guide-entry-renderer" disable-upgrade=""></yt-icon><div id="newness-dot" class="style-scope ytd-guide-entry-renderer"></div></tp-yt-paper-item></a><yt-interaction class="style-scope ytd-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction></ytd-guide-entry-renderer>`;
  250. document.querySelector(`#items > ytd-mini-guide-entry-renderer:nth-child(2)`).data = trendingData;
  251. }
  252. waitForElm("#items.ytd-guide-section-renderer").then((elm) => {
  253. restoreTrending();
  254. });
  255. waitForElm("#items.ytd-mini-guide-section-renderer").then((elm) => {
  256. restoreTrending();
  257. });
  258.  
  259. // Auto redirect shorts to watch page (credit goes to YukisCoffee and Fuim)
  260. var oldHref = document.location.href;
  261. if (window.location.href.indexOf('youtube.com/shorts') > -1) {
  262. window.location.replace(window.location.toString().replace('/shorts/', '/watch?v='));
  263. }
  264. window.onload = function() {
  265. var bodyList = document.querySelector("body")
  266. var observer = new MutationObserver(function(mutations) {
  267. mutations.forEach(function(mutation) {
  268. if (oldHref != document.location.href) {
  269. oldHref = document.location.href;
  270. console.log('location changed!');
  271. if (window.location.href.indexOf('youtube.com/shorts') > -1) {
  272. window.location.replace(window.location.toString().replace('/shorts/', '/watch?v='));
  273. }
  274. }
  275. });
  276. });
  277. var config = {
  278. childList: true,
  279. subtree: true
  280. };
  281. observer.observe(bodyList, config);
  282. };
  283.  
  284. /**
  285. * Shorts URL redirect.
  286. *
  287. * This is called on initial visit only. Successive navigations
  288. * are managed by modifying the YouTube Desktop application.
  289. */
  290. (function(){
  291.  
  292. /** @type {string} */
  293. var path = window.location.pathname;
  294.  
  295. if (0 == path.search("/shorts"))
  296. {
  297. // Extract the video ID from the shorts link and redirect.
  298.  
  299. /** @type {string} */
  300. var id = path.replace(/\/|shorts|\?.*/g, "");
  301.  
  302. window.location.replace("https://www.youtube.com/watch?v=" + id);
  303. }
  304.  
  305. })();
  306.  
  307. /**
  308. * YouTube Desktop Shorts remover.
  309. *
  310. * If the initial URL was not a shorts link, traditional redirection
  311. * will not work. This instead modifies video elements to replace them with
  312. * regular links.
  313. */
  314. (function(){
  315.  
  316. /**
  317. * @param {string} selector (CSS-style) of the element
  318. * @return {Promise<Element>}
  319. */
  320. async function querySelectorAsync(selector)
  321. {
  322. while (null == document.querySelector(selector))
  323. {
  324. // Pause for a frame and let other code go on.
  325. await new Promise(r => requestAnimationFrame(r));
  326. }
  327.  
  328. return document.querySelector(selector);
  329. }
  330.  
  331. /**
  332. * Small toolset for interacting with the Polymer
  333. * YouTube Desktop application.
  334. *
  335. * @author Taniko Yamamoto <kirasicecreamm@gmail.com>
  336. * @version 1.0
  337. */
  338. class YtdTools
  339. {
  340. /** @type {string} Page data updated event */
  341. static EVT_DATA_UPDATE = "yt-page-data-updated";
  342.  
  343. /** @type {Element} Main YT Polymer manager */
  344. static YtdApp;
  345.  
  346. /** @type {bool} */
  347. static hasInitialLoaded = false;
  348.  
  349. /** @return {Promise<bool>} */
  350. static async isPolymer()
  351. {
  352. /** @return {Promise<void>} */
  353. function waitForBody() // nice hack lazy ass
  354. {
  355. return new Promise(r => {
  356. document.addEventListener("DOMContentLoaded", function a(){
  357. document.removeEventListener("DOMContentLoaded", a);
  358. r();
  359. });
  360. });
  361. }
  362.  
  363. await waitForBody();
  364.  
  365. if ("undefined" != typeof document.querySelector("ytd-app"))
  366. {
  367. this.YtdApp = document.querySelector("ytd-app");
  368. return true;
  369. }
  370. return false;
  371. }
  372.  
  373. /** @async @return {Promise<void|string>} */
  374. static waitForInitialLoad()
  375. {
  376. var updateEvent = this.EVT_DATA_UPDATE;
  377. return new Promise((resolve, reject) => {
  378. if (!this.isPolymer())
  379. {
  380. reject("Not Polymer :(");
  381. }
  382.  
  383. function _listenerCb()
  384. {
  385. document.removeEventListener(updateEvent, _listenerCb);
  386. resolve();
  387. }
  388.  
  389. document.addEventListener(updateEvent, _listenerCb);
  390. });
  391. }
  392.  
  393. /** @return {string} */
  394. static getPageType()
  395. {
  396. return this.YtdApp.data.page;
  397. }
  398. }
  399.  
  400. class ShortsTools
  401. {
  402. /** @type {MutationObserver} */
  403. static mo = new MutationObserver(muts => {
  404. muts.forEach(mut => {
  405. Array.from(mut.addedNodes).forEach(node => {
  406. if (node instanceof HTMLElement) {
  407. this.onMutation(node);
  408. }
  409. });
  410. });
  411. });
  412.  
  413. /** @return {void} */
  414. static watchForShorts()
  415. {
  416. /*
  417. this.mo.observe(YtdTools.YtdApp, {
  418. childList: true,
  419. subtree: true
  420. });
  421. */
  422. var me = this;
  423. YtdTools.YtdApp.arrive("ytd-video-renderer, ytd-grid-video-renderer", function() {
  424. me.onMutation(this);
  425.  
  426. // This is literally the worst hack I ever wrote, but it works ig...
  427. (new MutationObserver(function(){
  428. if (me.isShortsRenderer(this))
  429. {
  430. me.onMutation(this);
  431. }
  432. }.bind(this))).observe(this, {"subtree": true, "childList": true, "characterData": "true"});
  433. });
  434. }
  435.  
  436. /** @return {void} */
  437. static stopWatchingForShorts()
  438. {
  439. this.mo.disconnect();
  440. }
  441.  
  442. /**
  443. * @param {HTMLElement} node
  444. * @return {void}
  445. */
  446. static onMutation(node)
  447. {
  448. if (node.tagName.search("VIDEO-RENDERER") > -1 && this.isShortsRenderer(node))
  449. {
  450. this.transformShortsRenderer(node);
  451. }
  452. }
  453.  
  454. /** @return {bool} */
  455. static isShortsRenderer(videoRenderer)
  456. {
  457. return "WEB_PAGE_TYPE_SHORTS" == videoRenderer?.data?.navigationEndpoint?.commandMetadata?.webCommandMetadata?.webPageType;
  458. }
  459.  
  460. /** @return {string} */
  461. static extractLengthFromA11y(videoData)
  462. {
  463. // A11y = {title} by {creator} {date} {*length*} {viewCount} - play Short
  464. // tho hopefully this works in more than just English
  465. var a11yTitle = videoData.title.accessibility.accessibilityData.label;
  466.  
  467. var publishedTimeText = videoData.publishedTimeText.simpleText;
  468. var viewCountText = videoData.viewCountText.simpleText;
  469.  
  470. var isolatedLengthStr = a11yTitle.split(publishedTimeText)[1].split(viewCountText)[0]
  471. .replace(/\s/g, "");
  472.  
  473. var numbers = isolatedLengthStr.split(/\D/g);
  474.  
  475. var string = "";
  476.  
  477. // Remove all empties before iterating it
  478. for (var i = 0; i < numbers.length; i++)
  479. {
  480. if ("" === numbers[i])
  481. {
  482. numbers.splice(i, 1);
  483. i--;
  484. }
  485. }
  486.  
  487. for (var i = 0; i < numbers.length; i++)
  488. {
  489. // Lazy 0 handling idc im tired
  490. if (1 == numbers.length)
  491. {
  492. string += "0:";
  493. if (1 == numbers[i].length)
  494. {
  495. string += "0" + numbers[i];
  496. }
  497. else
  498. {
  499. string += numbers[i];
  500. }
  501.  
  502. break;
  503. }
  504.  
  505. if (0 != i) string += ":";
  506. if (0 != i && 1 == numbers[i].length) string += "0";
  507. string += numbers[i];
  508. }
  509.  
  510. return string;
  511. }
  512.  
  513. /**
  514. * @param {HTMLElement} videoRenderer
  515. * @return {void}
  516. */
  517. static transformShortsRenderer(videoRenderer)
  518. {
  519.  
  520. /** @type {string} */
  521. var originalOuterHTML = videoRenderer.outerHTML;
  522.  
  523. /** @type {string} */
  524. var lengthText = videoRenderer.data?.lengthText?.simpleText ?? this.extractLengthFromA11y(videoRenderer.data);
  525.  
  526. /** @type {string} */
  527. var lengthA11y = videoRenderer.data?.lengthText?.accessibility?.accessibilityData?.label ?? "";
  528.  
  529. /** @type {string} */
  530. var originalHref = videoRenderer.data.navigationEndpoint.commandMetadata.webCommandMetadata.url;
  531. var href = "/watch?v=" + originalHref.replace(/\/|shorts|\?.*/g, "");
  532.  
  533. var reelWatchEndpoint = videoRenderer.data.navigationEndpoint.reelWatchEndpoint;
  534.  
  535. var i;
  536. videoRenderer.data.thumbnailOverlays.forEach((a, index) =>{
  537. if ("thumbnailOverlayTimeStatusRenderer" in a)
  538. {
  539. i = index;
  540. }
  541. });
  542.  
  543. // Set the thumbnail overlay style
  544. videoRenderer.data.thumbnailOverlays[i].thumbnailOverlayTimeStatusRenderer.style = "DEFAULT";
  545.  
  546. delete videoRenderer.data.thumbnailOverlays[i].thumbnailOverlayTimeStatusRenderer.icon;
  547.  
  548. // Set the thumbnail overlay text
  549. videoRenderer.data.thumbnailOverlays[i].thumbnailOverlayTimeStatusRenderer.text.simpleText = lengthText;
  550.  
  551. // Set the thumbnail overlay accessibility label
  552. videoRenderer.data.thumbnailOverlays[i].thumbnailOverlayTimeStatusRenderer.text.accessibility.accessibilityData.label = lengthA11y;
  553.  
  554. // Set the navigation endpoint metadata (used for middle click)
  555. videoRenderer.data.navigationEndpoint.commandMetadata.webCommandMetadata.webPageType = "WEB_PAGE_TYPE_WATCH";
  556. videoRenderer.data.navigationEndpoint.commandMetadata.webCommandMetadata.url = href;
  557.  
  558. videoRenderer.data.navigationEndpoint.watchEndpoint = {
  559. "videoId": reelWatchEndpoint.videoId,
  560. "playerParams": reelWatchEndpoint.playerParams,
  561. "params": reelWatchEndpoint.params
  562. };
  563. delete videoRenderer.data.navigationEndpoint.reelWatchEndpoint;
  564.  
  565. //var _ = videoRenderer.data; videoRenderer.data = {}; videoRenderer.data = _;
  566.  
  567. // Sometimes the old school data cycle trick fails,
  568. // however this always works.
  569. var _ = videoRenderer.cloneNode();
  570. _.data = videoRenderer.data;
  571. for (var i in videoRenderer.properties)
  572. {
  573. _[i] = videoRenderer[i];
  574. }
  575. videoRenderer.insertAdjacentElement("afterend", _);
  576. videoRenderer.remove();
  577. }
  578. }
  579.  
  580. /**
  581. * Sometimes elements are reused on page updates, so fix that
  582. *
  583. * @return {void}
  584. */
  585. function onDataUpdate()
  586. {
  587. var videos = document.querySelectorAll("ytd-video-renderer, ytd-grid-video-renderer");
  588.  
  589. for (var i = 0, l = videos.length; i < l; i++) if (ShortsTools.isShortsRenderer(videos[i]))
  590. {
  591. ShortsTools.transformShortsRenderer(videos[i]);
  592. }
  593. }
  594.  
  595. /**
  596. * I hope she makes lotsa spaghetti :D
  597. * @async @return {Promise<void>}
  598. */
  599. async function main()
  600. {
  601. // If not Polymer, nothing happens
  602. if (await YtdTools.isPolymer())
  603. {
  604. ShortsTools.watchForShorts();
  605.  
  606. document.addEventListener("yt-page-data-updated", onDataUpdate);
  607. }
  608. }
  609.  
  610. main();
  611.  
  612. })();
  613.  
  614. // Fix for like and dislike ratio (Return YouTube Dislike is required)
  615. function $(q) {
  616. return document.querySelector(q);
  617. }
  618. addEventListener('yt-page-data-updated', function() {
  619. if(!location.pathname.startsWith('/watch')) return;
  620. var lds = $('ytd-video-primary-info-renderer div#top-level-buttons-computed');
  621. var like = $('ytd-video-primary-info-renderer div#segmented-like-button > ytd-toggle-button-renderer');
  622. var share = $('ytd-video-primary-info-renderer div#top-level-buttons-computed > ytd-segmented-like-dislike-button-renderer + ytd-button-renderer');
  623. lds.insertBefore(like, share);
  624. like.setAttribute('class', like.getAttribute('class').replace('ytd-segmented-like-dislike-button-renderer', 'ytd-menu-renderer force-icon-button'));
  625. like.removeAttribute('is-paper-button-with-icon');
  626. like.removeAttribute('is-paper-button');
  627. like.setAttribute('style-action-button', '');
  628. like.setAttribute('is-icon-button', '');
  629. like.querySelector('a').insertBefore(like.querySelector('yt-formatted-string'), like.querySelector('tp-yt-paper-tooltip'));
  630. try { like.querySelector('paper-ripple').remove(); } catch(e) {}
  631. var paper = like.querySelector('tp-yt-paper-button');
  632. paper.removeAttribute('style-target');
  633. paper.removeAttribute('animated');
  634. paper.removeAttribute('elevation');
  635. like.querySelector('a').insertBefore(paper.querySelector('yt-icon'), like.querySelector('yt-formatted-string'));
  636. paper.outerHTML = paper.outerHTML.replace('<tp-yt-paper-button ', '<yt-icon-button ').replace('</tp-yt-paper-button>', '</yt-icon-button>');
  637. paper = like.querySelector('yt-icon-button');
  638. paper.querySelector('button#button').appendChild(like.querySelector('yt-icon'));
  639. var dislike = $('ytd-video-primary-info-renderer div#segmented-dislike-button > ytd-toggle-button-renderer');
  640. lds.insertBefore(dislike, share);
  641. $('ytd-video-primary-info-renderer ytd-segmented-like-dislike-button-renderer').remove();
  642. dislike.setAttribute('class', dislike.getAttribute('class').replace('ytd-segmented-like-dislike-button-renderer', 'ytd-menu-renderer force-icon-button'));
  643. dislike.removeAttribute('has-no-text');
  644. dislike.setAttribute('style-action-button', '');
  645. var dlabel = document.createElement('yt-formatted-stringx');
  646. dlabel.setAttribute('id', 'text');
  647. if(dislike.getAttribute('class').includes('style-default-active'))
  648. dlabel.setAttribute('class', dlabel.getAttribute('class').replace('style-default', 'style-default-active'));
  649. dislike.querySelector('a').insertBefore(dlabel, dislike.querySelector('tp-yt-paper-tooltip'));
  650. $('ytd-video-primary-info-renderer').removeAttribute('flex-menu-enabled');
  651. });
  652.  
  653. // Restore old comment replies UI
  654. var observingComments = false;
  655. var hl;
  656.  
  657. const cfconfig = {
  658. unicodeEmojis: false
  659. };
  660.  
  661. const cfi18n = {
  662. en: {
  663. viewSingular: "View reply",
  664. viewMulti: "View %s replies",
  665. viewSingularOwner: "View reply from %s",
  666. viewMultiOwner: "View %s replies from %s and others",
  667. hideSingular: "Hide reply",
  668. hideMulti: "Hide replies",
  669. replyCountIsolator: /( REPLIES)|( REPLY)/
  670. }
  671. }
  672.  
  673. /**
  674. * Get a string from the localization strings.
  675. *
  676. * @param {string} string Name of string to get
  677. * @param {string} hl Language to use.
  678. * @param {...array} args Strings.
  679. * @returns {string}
  680. */
  681. function getString(string, hl = "en", ...args) {
  682. if (!string) return;
  683. var str;
  684. if (cfi18n[hl]) {
  685. if (cfi18n[hl][string]) {
  686. str = cfi18n[hl][string];
  687. } else if (cfi18n.en[string]) {
  688. str = cfi18n.en[string];
  689. } else {
  690. return;
  691. }
  692. } else {
  693. if (cfi18n.en[string]) str = cfi18n.en[string];
  694. }
  695.  
  696. for (var i = 0; i < args.length; i++) {
  697. str = str.replace(/%s/, args[i]);
  698. }
  699.  
  700. return str;
  701. }
  702.  
  703. /**
  704. * Wait for a selector to exist
  705. *
  706. * @param {string} selector CSS Selector
  707. * @param {HTMLElement} base Element to search inside
  708. * @returns {Node}
  709. */
  710. async function waitForElm(selector, base = document) {
  711. if (!selector) return null;
  712. if (!base.querySelector) return null;
  713. while (base.querySelector(selector) == null) {
  714. await new Promise(r => requestAnimationFrame(r));
  715. };
  716. return base.querySelector(selector);
  717. };
  718.  
  719. /**
  720. * Is a value in an array?
  721. *
  722. * @param {*} needle Value to search
  723. * @param {Array} haystack Array to search
  724. * @returns {boolean}
  725. */
  726. function inArray(needle, haystack) {
  727. for (var i = 0; i < haystack.length; i++) {
  728. if (needle == haystack[i]) return true;
  729. }
  730. return false;
  731. }
  732.  
  733. /**
  734. * Get text of an InnerTube string.
  735. *
  736. * @param {object} object String container.
  737. */
  738. function getSimpleString(object) {
  739. if (object.simpleText) return object.simpleText;
  740.  
  741. var str = "";
  742. for (var i = 0; i < object.runs.length; i++) {
  743. str += object.runs[i].text;
  744. }
  745. return str;
  746. }
  747.  
  748. /**
  749. * Format a commentRenderer.
  750. *
  751. * @param {object} comment commentRenderer from InnerTube.
  752. */
  753. function formatComment(comment) {
  754. if (cfconfig.unicodeEmojis) {
  755. var runs;
  756. try {
  757. runs = comment.contentText.runs
  758. for (var i = 0; i < runs.length; i++) {
  759. delete runs[i].emoji;
  760. delete runs[i].loggingDirectives;
  761. }
  762. } catch(err) {}
  763. }
  764.  
  765. return comment;
  766. }
  767.  
  768. /**
  769. * Format a commentThreadRenderer.
  770. *
  771. * @param {object} thread commentThreadRenderer from InnerTube.
  772. */
  773. async function formatCommentThread(thread) {
  774. if (thread.comment.commentRenderer) {
  775. thread.comment.commentRenderer = formatComment(thread.comment.commentRenderer);
  776. }
  777.  
  778. var replies;
  779. try {
  780. replies = thread.replies.commentRepliesRenderer;
  781. if (replies.viewRepliesIcon) {
  782. replies.viewReplies.buttonRenderer.icon = replies.viewRepliesIcon.buttonRenderer.icon;
  783. delete replies.viewRepliesIcon;
  784. }
  785.  
  786. if (replies.hideRepliesIcon) {
  787. replies.hideReplies.buttonRenderer.icon = replies.hideRepliesIcon.buttonRenderer.icon;
  788. delete replies.hideRepliesIcon;
  789. }
  790.  
  791. var creatorName;
  792. try {
  793. creatorName = replies.viewRepliesCreatorThumbnail.accessibility.accessibilityData.label;
  794. delete replies.viewRepliesCreatorThumbnail;
  795. } catch(err) {}
  796.  
  797. var replyCount = getSimpleString(replies.viewReplies.buttonRenderer.text);
  798. replyCount = +replyCount.replace(getString("replyCountIsolator", hl), "");
  799.  
  800. var viewMultiString = creatorName ? "viewMultiOwner" : "viewMulti";
  801. var viewSingleString = creatorName ? "viewSingularOwner" : "viewSingular";
  802.  
  803. replies.viewReplies.buttonRenderer.text = {
  804. runs: [
  805. {
  806. text: (replyCount > 1) ? getString(viewMultiString, hl, replyCount, creatorName) : getString(viewSingleString, hl, creatorName)
  807. }
  808. ]
  809. }
  810.  
  811. replies.hideReplies.buttonRenderer.text = {
  812. runs: [
  813. {
  814. text: (replyCount > 1) ? getString("hideMulti", hl) : getString("hideSingular", hl)
  815. }
  816. ]
  817. };
  818. } catch(err) {}
  819.  
  820. return thread;
  821. }
  822.  
  823. /**
  824. * Force Polymer to refresh data of an element.
  825. *
  826. * @param {Node} element Element to refresh data of.
  827. */
  828. function refreshData(element) {
  829. var clone = element.cloneNode();
  830. clone.data = element.data;
  831. // Let the script know we left our mark
  832. // in a way that doesn't rely on classes
  833. // because Polymer likes to cast comments
  834. // into the void for later reuse
  835. clone.data.fixedByCF = true;
  836. for (var i in element.properties) {
  837. clone[i] = element[i];
  838. }
  839. element.insertAdjacentElement("afterend", clone);
  840. element.remove();
  841. }
  842.  
  843. var commentObserver = new MutationObserver((list) => {
  844. list.forEach(async (mutation) => {
  845. if (mutation.addedNodes) {
  846. for (var i = 0; i < mutation.addedNodes.length; i++) {
  847. var elm = mutation.addedNodes[i];
  848. if (elm.classList && elm.data && !elm.data.fixedByCF) {
  849. if (elm.tagName == "YTD-COMMENT-THREAD-RENDERER") {
  850. elm.data = await formatCommentThread(elm.data);
  851. refreshData(elm);
  852. } else if (elm.tagName == "YTD-COMMENT-RENDERER") {
  853. if (!elm.classList.contains("ytd-comment-thread-renderer")) {
  854. elm.data = formatComment(elm.data);
  855. refreshData(elm);
  856. }
  857. }
  858. }
  859. }
  860. }
  861. });
  862. });
  863.  
  864. document.addEventListener("yt-page-data-updated", async (e) => {
  865. hl = yt.config_.HL;
  866. commentObserver.observe(document.querySelector("ytd-app"), { childList: true, subtree: true });
  867. });
  868.  
  869. // CSS adjustments and UI fixes (both userstyles are required) + Remove "Video paused. Continue watching?" popup
  870. (function() {
  871. ApplyCSS();
  872. function ApplyCSS() {
  873. var styles = document.createElement("style");
  874. styles.innerHTML=`
  875. /* Disable rounded corners on search box + revert old channel UI */
  876. #container.ytd-searchbox {
  877. background-color: var(--ytd-searchbox-background) !important;
  878. border-radius: 2px 0 0 2px !important;
  879. box-shadow: inset 0 1px 2px var(--ytd-searchbox-legacy-border-shadow-color) !important;
  880. color: var(--ytd-searchbox-text-color) !important;
  881. padding: 2px 6px !important;
  882. }
  883.  
  884. ytd-searchbox[desktop-searchbar-style="rounded_corner_dark_btn"] #searchbox-button.ytd-searchbox {
  885. display: none !important;
  886. }
  887.  
  888. ytd-searchbox[desktop-searchbar-style="rounded_corner_light_btn"] #searchbox-button.ytd-searchbox {
  889. display: none !important;
  890. }
  891.  
  892. #search[has-focus] #search-input {
  893. margin-left: 32px !important;
  894. }
  895.  
  896. #search-icon-legacy.ytd-searchbox {
  897. display: block !important;
  898. border-radius: 0px 2px 2px 0px !important;
  899. }
  900.  
  901. .sbsb_a {
  902. border-radius: 2px !important;
  903. }
  904.  
  905. .sbsb_c {
  906. padding-left: 10px !important;
  907. }
  908.  
  909. div.sbqs_c::before {
  910. margin-right: 10px !important;
  911. }
  912.  
  913. ytd-searchbox[has-focus] #search-icon.ytd-searchbox {
  914. padding-left: 10px !important;
  915. padding-right: 10px !important;
  916. }
  917.  
  918. #channel-container.ytd-c4-tabbed-header-renderer {
  919. height: 100px !important;
  920. }
  921. #contentContainer.tp-yt-app-header-layout {
  922. padding-top: 353px !important;
  923. }
  924. #channel-header-container.ytd-c4-tabbed-header-renderer {
  925. padding-top: 0 !important;
  926. }
  927. ytd-c4-tabbed-header-renderer[use-modern-style] #channel-name.ytd-c4-tabbed-header-renderer {
  928. margin-bottom: 0px !important;
  929. }
  930.  
  931. ytd-c4-tabbed-header-renderer[use-modern-style] #avatar-editor.ytd-c4-tabbed-header-renderer {
  932. --ytd-channel-avatar-editor-size: 80px !important;
  933. }
  934. #avatar.ytd-c4-tabbed-header-renderer {
  935. width: 80px !important;
  936. height: 80px !important;
  937. margin: 0 24px 0 0 !important;
  938. flex: none !important;
  939. border-radius: 50% !important;
  940. background-color: transparent !important;
  941. overflow: hidden !important;
  942. }
  943. #wrapper > .ytd-channel-tagline-renderer.style-scope,#videos-count {
  944. display: none !important;
  945. }
  946.  
  947. /* Disable rounded corners on watch and other pages (including inform news) */
  948. #cinematics.ytd-watch-flexy {
  949. display: none !important;
  950. }
  951.  
  952. div#clarify-box.attached-message.style-scope.ytd-watch-flexy {
  953. margin-top: 0px !important;
  954. }
  955.  
  956. ytd-clarification-renderer.style-scope.ytd-item-section-renderer {
  957. border: 1px solid !important;
  958. border-color: #0000001a !important;
  959. border-radius: 0px !important;
  960. }
  961.  
  962. ytd-clarification-renderer.style-scope.ytd-watch-flexy {
  963. border: 1px solid !important;
  964. border-color: #0000001a !important;
  965. border-radius: 0px !important;
  966. }
  967.  
  968. yt-formatted-string.description.style-scope.ytd-clarification-renderer {
  969. font-size: 1.4rem !important;
  970. }
  971.  
  972. div.content-title.style-scope.ytd-clarification-renderer {
  973. padding-bottom: 4px !important;
  974. }
  975.  
  976. ytd-rich-metadata-renderer[rounded] {
  977. border-radius: 0px !important;
  978. }
  979.  
  980. ytd-live-chat-frame[rounded-container] {
  981. border-radius: 0px !important;
  982. }
  983.  
  984. ytd-live-chat-frame[rounded-container] #show-hide-button.ytd-live-chat-frame ytd-toggle-button-renderer.ytd-live-chat-frame {
  985. border-radius: 0px !important;
  986. }
  987.  
  988. iframe.style-scope.ytd-live-chat-frame {
  989. border-radius: 0px !important;
  990. }
  991.  
  992. ytd-playlist-panel-renderer[modern-panels]:not([within-miniplayer]) #container.ytd-playlist-panel-renderer {
  993. border-radius: 0px !important;
  994. }
  995.  
  996. ytd-playlist-panel-renderer[modern-panels]:not([hide-header-text]) .title.ytd-playlist-panel-renderer {
  997. font-family: Roboto !important;
  998. font-size: 1.4rem !important;
  999. line-height: 2rem !important;
  1000. font-weight: 500 !important;
  1001. }
  1002.  
  1003. ytd-tvfilm-offer-module-renderer[modern-panels] {
  1004. border-radius: 0px !important;
  1005. }
  1006.  
  1007. ytd-tvfilm-offer-module-renderer[modern-panels] #header.ytd-tvfilm-offer-module-renderer {
  1008. border-radius: 0px !important;
  1009. font-family: Roboto !important;
  1010. font-size: 1.6rem !important;
  1011. line-height: 2.2rem !important;
  1012. font-weight: 400 !important;
  1013. }
  1014.  
  1015. ytd-donation-shelf-renderer.style-scope.ytd-watch-flexy {
  1016. border-radius: 0px !important;
  1017. }
  1018.  
  1019. ytd-donation-shelf-renderer[modern-panels] #header-text.ytd-donation-shelf-renderer {
  1020. font-family: Roboto !important;
  1021. font-size: 1.6rem !important;
  1022. font-weight: 500 !important;
  1023. }
  1024.  
  1025. ytd-channel-video-player-renderer[rounded] #player.ytd-channel-video-player-renderer {
  1026. border-radius: 0px !important;
  1027. }
  1028.  
  1029. ytd-universal-watch-card-renderer[rounded] #header.ytd-universal-watch-card-renderer {
  1030. border-radius: 0px !important;
  1031. }
  1032.  
  1033. ytd-universal-watch-card-renderer[rounded] #hero.ytd-universal-watch-card-renderer {
  1034. border-radius: 0px !important;
  1035. }
  1036.  
  1037. /* Disable rounded corners under the player */
  1038. .ytp-ad-player-overlay-flyout-cta-rounded {
  1039. border-radius: 2px !important;
  1040. }
  1041.  
  1042. .ytp-ad-overlay-container.ytp-rounded-overlay-ad .ytp-ad-overlay-image img, .ytp-ad-overlay-container.ytp-rounded-overlay-ad .ytp-ad-text-overlay, .ytp-ad-overlay-container.ytp-rounded-overlay-ad .ytp-ad-enhanced-overlay {
  1043. border-radius: 0px !important;
  1044. }
  1045.  
  1046. .ytp-flyout-cta .ytp-flyout-cta-action-button.ytp-flyout-cta-action-button-rounded {
  1047. border-radius: 2px !important;
  1048. text-transform: uppercase !important;
  1049. }
  1050.  
  1051. .ytp-ad-action-interstitial-action-button.ytp-ad-action-interstitial-action-button-rounded {
  1052. border-radius: 2px !important;
  1053. text-transform: uppercase !important;
  1054. }
  1055. div#ytp-id-18.ytp-popup,ytp-settings-menu.ytp-rounded-menu {
  1056. border-radius: 2px !important;
  1057. }
  1058. div.branding-context-container-inner.ytp-rounded-branding-context {
  1059. border-radius: 2px !important;
  1060. }
  1061. div.iv-card.iv-card-video.ytp-rounded-info {
  1062. border-radius: 0px !important;
  1063. }
  1064. div.iv-card.iv-card-playlist.ytp-rounded-info {
  1065. border-radius: 0px !important;
  1066. }
  1067. div.iv-card.iv-card-channel.ytp-rounded-info {
  1068. border-radius: 0px !important;
  1069. }
  1070. div.iv-card.ytp-rounded-info {
  1071. border-radius: 0px !important;
  1072. }
  1073. .ytp-tooltip.ytp-rounded-tooltip.ytp-text-detail.ytp-preview, .ytp-tooltip.ytp-rounded-tooltip.ytp-text-detail.ytp-preview .ytp-tooltip-bg {
  1074. border-radius: 0px !important;
  1075. }
  1076. .ytp-ce-video.ytp-ce-medium-round, .ytp-ce-playlist.ytp-ce-medium-round, .ytp-ce-medium-round .ytp-ce-expanding-overlay-background {
  1077. border-radius: 0px !important;
  1078. }
  1079. div.ytp-autonav-endscreen-upnext-thumbnail.rounded-thumbnail {
  1080. border-radius: 0px !important;
  1081. }
  1082. button.ytp-autonav-endscreen-upnext-button.ytp-autonav-endscreen-upnext-cancel-button.ytp-autonav-endscreen-upnext-button-rounded {
  1083. border-radius: 2px !important;
  1084. }
  1085. a.ytp-autonav-endscreen-upnext-button.ytp-autonav-endscreen-upnext-play-button.ytp-autonav-endscreen-upnext-button-rounded {
  1086. border-radius: 2px !important;
  1087. }
  1088. .ytp-videowall-still-image {
  1089. border-radius: 0px !important;
  1090. }
  1091. div.ytp-sb-subscribe.ytp-sb-rounded, .ytp-sb-unsubscribe.ytp-sb-rounded {
  1092. border-radius: 2px !important;
  1093. }
  1094.  
  1095. /* Subscribe button fix when you are logged in */
  1096. #buttons.ytd-c4-tabbed-header-renderer {
  1097. flex-direction: row-reverse !important;
  1098. }
  1099.  
  1100. yt-button-shape.style-scope.ytd-subscribe-button-renderer {
  1101. display: flex !important;
  1102. }
  1103.  
  1104. #subscribe-button ytd-subscribe-button-renderer button {
  1105. height: 37px !important;
  1106. letter-spacing: 0.5px !important;
  1107. border-radius: 2px !important;
  1108. text-transform: uppercase !important;
  1109. }
  1110.  
  1111. .yt-spec-button-shape-next--mono.yt-spec-button-shape-next--filled {
  1112. color: #fff !important;
  1113. background: #c00 !important;
  1114. border-radius: 2px !important;
  1115. text-transform: uppercase !important;
  1116. letter-spacing: 0.5px !important;
  1117. }
  1118.  
  1119. button.yt-spec-button-shape-next.yt-spec-button-shape-next--tonal.yt-spec-button-shape-next--mono.yt-spec-button-shape-next--size-s {
  1120. height: 25px !important;
  1121. letter-spacing: 0.5px !important;
  1122. border-radius: 2px !important;
  1123. text-transform: uppercase !important;
  1124. }
  1125.  
  1126. div#notification-preference-button.style-scope.ytd-subscribe-button-renderer > ytd-subscription-notification-toggle-button-renderer-next.style-scope.ytd-subscribe-button-renderer > yt-button-shape > .yt-spec-button-shape-next--size-m {
  1127. background-color: transparent !important;
  1128. border-radius: 16px !important;
  1129. padding-left: 14px !important;
  1130. padding-right: 2px !important;
  1131. margin-left: 4px !important;
  1132. }
  1133.  
  1134. div#notification-preference-button.style-scope.ytd-subscribe-button-renderer > ytd-subscription-notification-toggle-button-renderer-next.style-scope.ytd-subscribe-button-renderer > yt-button-shape > .yt-spec-button-shape-next--size-m > div.cbox.yt-spec-button-shape-next--button-text-content {
  1135. display: none !important;
  1136. }
  1137.  
  1138. div#notification-preference-button.style-scope.ytd-subscribe-button-renderer > ytd-subscription-notification-toggle-button-renderer-next.style-scope.ytd-subscribe-button-renderer > yt-button-shape > .yt-spec-button-shape-next--size-m > div.yt-spec-button-shape-next__secondary-icon {
  1139. display: none !important;
  1140. }
  1141.  
  1142. /* General UI fixes (old theme color and remove more rounded corners) */
  1143. ytd-masthead {
  1144. background: var(--yt-spec-brand-background-solid) !important;
  1145. }
  1146. ytd-app {
  1147. background: var(--yt-spec-general-background-a) !important;
  1148. }
  1149.  
  1150. ytd-browse[page-subtype="channels"] {
  1151. background: var(--yt-spec-general-background-b) !important;
  1152. }
  1153.  
  1154. ytd-c4-tabbed-header-renderer {
  1155. --yt-lightsource-section1-color: var(--yt-spec-general-background-a) !important;
  1156. }
  1157.  
  1158. #guide-content.ytd-app {
  1159. background: var(--yt-spec-brand-background-solid) !important;
  1160. }
  1161.  
  1162. ytd-guide-entry-renderer[guide-refresh] {
  1163. width: 100% !important;
  1164. border-radius: 0px !important;
  1165. }
  1166.  
  1167. ytd-mini-guide-renderer {
  1168. background-color: var(--yt-spec-brand-background-solid) !important;
  1169. }
  1170.  
  1171. ytd-mini-guide-entry-renderer {
  1172. background-color: var(--yt-spec-brand-background-solid) !important;
  1173. border-radius: 0 !important;
  1174. }
  1175. ytd-guide-section-renderer.style-scope.ytd-guide-renderer {
  1176. padding-left: 0px !important;
  1177. }
  1178.  
  1179. ytd-mini-guide-renderer[guide-refresh] {
  1180. padding: 0 !important;
  1181. }
  1182.  
  1183. ytd-guide-entry-renderer[active] {
  1184. border-radius: 0px !important;
  1185. }
  1186.  
  1187. .style-scope.ytd-guide-entry-renderer:hover {
  1188. border-radius: 0 !important;
  1189. }
  1190. tp-yt-paper-item.style-scope.ytd-guide-entry-renderer {
  1191. border-radius: 0px !important;
  1192. padding-left: 24px !important;
  1193. }
  1194.  
  1195. #guide-section-title.ytd-guide-section-renderer {
  1196. color: var(--yt-spec-text-secondary) !important;
  1197. padding: 8px 24px !important;
  1198. font-size: var(--ytd-tab-system-font-size) !important;
  1199. font-weight: var(--ytd-tab-system-font-weight) !important;
  1200. letter-spacing: var(--ytd-tab-system-letter-spacing) !important;
  1201. text-transform: var(--ytd-tab-system-text-transform) !important;
  1202. }
  1203.  
  1204. yt-chip-cloud-chip-renderer {
  1205. height: 32px !important;
  1206. border: 1px solid var(--yt-spec-10-percent-layer) !important;
  1207. border-radius: 16px !important;
  1208. box-sizing: border-box !important;
  1209. }
  1210.  
  1211. [page-subtype="home"] #chips-wrapper.ytd-feed-filter-chip-bar-renderer {
  1212. background-color: var(--yt-spec-brand-background-primary) !important;
  1213. border-top: 1px solid var(--yt-spec-10-percent-layer) !important;
  1214. border-bottom: 1px solid var(--yt-spec-10-percent-layer) !important;
  1215. }
  1216.  
  1217. ytd-feed-filter-chip-bar-renderer[component-style=FEED_FILTER_CHIP_BAR_STYLE_TYPE_CHANNEL_PAGE_GRID] #chips-wrapper.ytd-feed-filter-chip-bar-renderer {
  1218. background-color: transparent !important;
  1219. }
  1220.  
  1221. ytd-multi-page-menu-renderer {
  1222. border-radius: 0px !important;
  1223. border: 1px solid var(--yt-spec-10-percent-layer) !important;
  1224. border-top: none !important;
  1225. box-shadow: none !important;
  1226. }
  1227.  
  1228. ytd-menu-popup-renderer {
  1229. border-radius: 0px !important;
  1230. }
  1231.  
  1232. #info.ytd-video-primary-info-renderer {
  1233. height: 40px !important;
  1234. }
  1235.  
  1236. #meta #avatar { width: 48px; height: 48px; margin-right: 16px; }
  1237. #meta #avatar img { width: 100%; }
  1238. #channel-name.ytd-video-owner-renderer {
  1239. font-size: 1.4rem !important;
  1240. }
  1241.  
  1242. /* Remove Shorts, Trending, Podcasts and Shopping in the guide menus */
  1243. #endpoint.yt-simple-endpoint.ytd-guide-entry-renderer.style-scope[title="Shorts"] {
  1244. display: none !important;
  1245. }
  1246.  
  1247. #endpoint.yt-simple-endpoint.ytd-mini-guide-entry-renderer.style-scope[title="Shorts"] {
  1248. display: none !important;
  1249. }
  1250.  
  1251. #endpoint.yt-simple-endpoint.ytd-guide-entry-renderer.style-scope[title="Trending"] {
  1252. display: none !important;
  1253. }
  1254.  
  1255. #endpoint.yt-simple-endpoint.ytd-guide-entry-renderer.style-scope[title="Podcasts"] {
  1256. display: none !important;
  1257. }
  1258.  
  1259. ytd-guide-entry-renderer > a[href*="/channel/UCkYQyvc_i9hXEo4xic9Hh2g"] {
  1260. display: none !important;
  1261. }`
  1262. document.head.appendChild(styles);
  1263. }
  1264. })();
  1265. Object.defineProperties(document, { 'hidden': {value: false}, 'webkitHidden': {value: false}, 'visibilityState': {value: 'visible'}, 'webkitVisibilityState': {value: 'visible'} });
  1266. setInterval(function(){
  1267. document.dispatchEvent( new KeyboardEvent( 'keyup', { bubbles: true, cancelable: true, keyCode: 143, which: 143 } ) );
  1268. }, 60000);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址