Skip to content

CSS Script only works when page is reloaded #753

Closed Answered by ACTCD
marlonjames71 asked this question in Q&A
Discussion options

You must be logged in to vote

So the final script should be:

// ==UserScript==
// @name           Hide YT Scrollbar
// @description    Hides the scrollbar on YouTube
// @match          *://*.youtube.com/*
// @exclude-match  *://music.youtube.com/*
// @exclude-match  *://*.music.youtube.com/*
// @inject-into    content
// @grant          GM.addStyle
// @run-at         document-start
// ==/UserScript==

GM.addStyle(`body::-webkit-scrollbar { width: 0 !important; }`);

NOTE that you should use @exclude-match instead of @exclude.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@marlonjames71
Comment options

@marlonjames71
Comment options

@ACTCD
Comment options

ACTCD Nov 15, 2024
Collaborator

@ACTCD
Comment options

ACTCD Nov 15, 2024
Collaborator

Answer selected by ACTCD
@marlonjames71
Comment options

@marlonjames71
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants