Scrollable YouTube recommendations (via userscript)

Last update:

When watching a video, YouTube shows additional recommendations on the right-hand side. Unfortunately this recommendations pane is not independently scrollable, meaning that the video being watched moves out of the visible area when scrolling the list of recommendations.

Here is a userscript to fix this.

A userscript is a JavaScript snippet, which can modify the current page at runtime. It is executed by the browser when the location predicate matches. Functionality can range from style adjustments (such as in this case) to augmenting the page with additional functionality.

I use Tampermonkey to manage userscripts. It is a successor to Greasemonkey, which made userscripts popular. I don’t know the advantages of each and haven’t spent much time researching alternatives.

// ==UserScript==
// @name         YouTube - scrollable recommendations pane
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Make recommendations pane scrollable so that video doesn't move out of visible area.
// @author       You
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==

// @match        https://www.youtube.com/watch?*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';
    GM_addStyle (`
        #secondary {
            overflow: scroll;
            height: 100vh;
        }
    `);
})();

See all posts in the archive.