Skip to content

Instantly share code, notes, and snippets.

@lassekongo83
Last active July 10, 2023 07:02
Show Gist options
  • Save lassekongo83/1a151cf12656c0e85eb2283a81594631 to your computer and use it in GitHub Desktop.
Save lassekongo83/1a151cf12656c0e85eb2283a81594631 to your computer and use it in GitHub Desktop.
Make YouTube use your browser's default scrollbar
// ==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