Last active
June 15, 2021 03:02
-
-
Save julian-weinert/425fa15d7117785e84cad6fbf8df460c to your computer and use it in GitHub Desktop.
User script which can be used with TamperMonkey and similar browser extensions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name YouTube Remove Themed Scrollbar | |
// @version 1.0.1 | |
// @description This script removes the themed YT-scrollbar one second after load. | |
// @author Julian Weinert | |
// @run-at document-start | |
// @match *://*.youtube.com/* | |
// @match *://*.youtu.be/* | |
// @updateURL https://gist.githubusercontent.com/julian-weinert/425fa15d7117785e84cad6fbf8df460c/raw/remove-youtube-scrollbar.js | |
// ==/UserScript== | |
function wrapSetAttribute(a) { | |
a._setAttribute = a.setAttribute; | |
a.setAttribute = function(attr) { | |
if (attr.includes('scrollbar')) { | |
return; | |
} | |
a._setAttribute(...arguments); | |
} | |
var attrs = [...a.attributes]; | |
attrs.forEach(attr => { | |
if (attr.nodeName.includes('scrollbar')) { | |
a.removeAttribute(attr.nodeName); | |
} | |
}); | |
} | |
wrapSetAttribute(document.documentElement); | |
wrapSetAttribute(document.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment