Youtube - unstick search bar and categories buttons row

Unsticks youtube search bar from the top, so it goes away by scrolling

目前为 2021-07-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Youtube - unstick search bar and categories buttons row
  3. // @description Unsticks youtube search bar from the top, so it goes away by scrolling
  4. // @namespace https://greasyfork.org/en/users/758587-barn852
  5. // @author barn852
  6. // @match *://www.youtube.com/*
  7. // @grant none
  8. // @version 1.0
  9. // @grant GM_addStyle
  10. // @run-at document-end
  11. // ==/UserScript==
  12.  
  13. function addGlobalStyle(css) {
  14. var head, style;
  15. head = document.getElementsByTagName('head')[0];
  16. if (!head) { return; }
  17. style = document.createElement('style');
  18. style.type = 'text/css';
  19. style.innerHTML = css;
  20. head.appendChild(style);
  21. }
  22.  
  23. // search bar, remove, put // in the front if you want to stick it to the top.
  24. addGlobalStyle( `div#masthead-container.ytd-app,ytd-mini-guide-renderer.ytd-app,app-drawer#guide{position:absolute!important}`); // search bar -
  25.  
  26. // button row
  27. addGlobalStyle( `#chips-wrapper {position:absolute!important;top:0!important} `);
  28. // addGlobalStyle( `ytd-feed-filter-chip-bar-renderer {position:relative!important} `);