Youtube - Wide video container

wide video container on youtube

当前为 2019-03-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Youtube - Wide video container
  3. // @namespace 1N07
  4. // @author 1N07
  5. // @description wide video container on youtube
  6. // @include https://www.youtube.com/*
  7. // @version 1.6.1
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. if(!!document.getElementById("early-body")) { //if old youtube
  12. document.getElementById("content").setAttribute("style", "width: 99%;");
  13. } else { //new youtube
  14. addGlobalStyle(`
  15. #page-manager > ytd-browse:not([page-subtype="playlist"]) ytd-two-column-browse-results-renderer.ytd-browse,
  16. ytd-browse ytd-video-masthead-ad-v3-renderer.ytd-browse
  17. {
  18. box-sizing: border-box;
  19. width: 99%;
  20. width: calc(100% - 20px) !important;
  21. position: relative !important;
  22. }
  23. `);
  24. }
  25.  
  26. function addGlobalStyle(css) {
  27. var head, style;
  28. head = document.getElementsByTagName('head')[0];
  29. if (!head) { return; }
  30. style = document.createElement('style');
  31. style.type = 'text/css';
  32. style.innerHTML = css;
  33. head.appendChild(style);
  34. }

QingJ © 2025

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