Youtube - unstick search bar and categories buttons row

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Youtube - unstick search bar and categories buttons row 
// @description     Unsticks youtube search bar from the top, so it goes away by scrolling
// @namespace       https://greasyfork.org/en/users/758587-barn852
// @author          barn852
// @match           *://www.youtube.com/*
// @grant           none
// @version         1.0
// @grant           GM_addStyle
// @run-at          document-end 
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

// search bar, remove, put // in the front if you want to stick it to the top.
addGlobalStyle( `div#masthead-container.ytd-app,ytd-mini-guide-renderer.ytd-app,app-drawer#guide{position:absolute!important}`); // search bar - 

// button row
addGlobalStyle( `#chips-wrapper {position:absolute!important;top:0!important} `); 
// addGlobalStyle( `ytd-feed-filter-chip-bar-renderer {position:relative!important} `);