Reddit Bigger Carousel

Modifies the Reddit's carousel to change the carousel height

目前為 2025-01-15 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            Reddit Bigger Carousel
// @description     Modifies the Reddit's carousel to change the carousel height
// @version         1.0.0
// @author          BreatFR
// @match           https://www.reddit.com/*
// @copyright       2025, BreatFR (https://breat.fr)
// @grant           none
// @namespace       https://gitlab.com/breatfr
// @homepageURL     https://gitlab.com/breatfr/reddit
// @icon            https://www.redditstatic.com/shreddit/assets/favicon/192x192.png
// @supportURL      https://discord.gg/Q8KSHzdBxs
// @license         AGPL-3.0-or-later; https://www.gnu.org/licenses/agpl-3.0.txt
// ==/UserScript==

(function() {
    'use strict';

    // Function to modify the carousel-style attribute
    function modifyCarouselStyle() {
        // Select all elements with the carousel-style attribute
        const carouselElements = document.querySelectorAll('[carousel-style]');

        carouselElements.forEach(element => {
            // Replace the value of the carousel-style attribute
            const currentStyle = element.getAttribute('carousel-style');
            const newStyle = currentStyle.replace(/max-height:\s*\d+px;/, 'max-height: 100%;');
            element.setAttribute('carousel-style', newStyle);
        });
    }

    // Execute the function after the page loads
    window.addEventListener('load', modifyCarouselStyle);

    // Execute the function periodically every 500 milliseconds
    setInterval(modifyCarouselStyle, 500);
})();