Strava Segments Scroll Fix

Adds scroll bar to the "Segments" table on cycling activities. 27/04/2026

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Strava Segments Scroll Fix
// @namespace    http://tampermonkey.net/
// @version      3.0
// @author       Strava!!!
// @license      MIT
// @description	 Adds scroll bar to the "Segments" table on cycling activities. 27/04/2026
// @match        https://www.strava.com/activities/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function applyScrollFix() {
        const table = document.querySelector('table.segments');
        if (!table || table.dataset.scrollFixApplied) return;

        table.dataset.scrollFixApplied = "true";

        const wrapper = document.createElement('div');

        // Slightly less than full viewport to match map area
        wrapper.style.maxHeight = '65vh';
        wrapper.style.overflowY = 'auto';

        table.parentNode.insertBefore(wrapper, table);
        wrapper.appendChild(table);
    }

    applyScrollFix();

    const observer = new MutationObserver(applyScrollFix);
    observer.observe(document.body, { childList: true, subtree: true });
})();