Last active
July 10, 2023 07:02
-
-
Save lassekongo83/1a151cf12656c0e85eb2283a81594631 to your computer and use it in GitHub Desktop.
Make YouTube use your browser's default scrollbar
This file contains 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 Restore YouTube Scrollbar | |
// @namespace Violentmonkey Scripts | |
// @match https://www.youtube.com/* | |
// @grant none | |
// @version 1.0 | |
// @author https://github.com/lassekongo83 | |
// @description Make YouTube use your browser's default scrollbar | |
// ==/UserScript== | |
function restoreScrollbar() { | |
'use strict'; | |
document.body.removeAttribute('standardized-themed-scrollbar'); | |
// For Firefox | |
document.querySelector('html').removeAttribute('standardized-themed-scrollbar'); | |
Element.prototype.removeAttributes = function(...attrs) { | |
attrs.forEach(attr => this.removeAttribute(attr)); | |
} | |
document.querySelector('ytd-app').removeAttributes('scrollbar-rework', 'standardized-themed-scrollbar'); | |
} | |
restoreScrollbar(); | |
document.querySelector('ytd-app').addEventListener('yt-visibility-refresh', restoreScrollbar); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment