Reddit Bigger Carousel

Modifies the Reddit's carousel to change the carousel height

  1. // ==UserScript==
  2. // @name Reddit Bigger Carousel
  3. // @description Modifies the Reddit's carousel to change the carousel height
  4. // @version 1.0.0
  5. // @author BreatFR
  6. // @match https://www.reddit.com/*
  7. // @copyright 2025, BreatFR (https://breat.fr)
  8. // @grant none
  9. // @namespace https://gitlab.com/breatfr
  10. // @homepageURL https://gitlab.com/breatfr/reddit
  11. // @icon https://www.redditstatic.com/shreddit/assets/favicon/192x192.png
  12. // @supportURL https://discord.gg/Q8KSHzdBxs
  13. // @license AGPL-3.0-or-later; https://www.gnu.org/licenses/agpl-3.0.txt
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. // Function to modify the carousel-style attribute
  20. function modifyCarouselStyle() {
  21. // Select all elements with the carousel-style attribute
  22. const carouselElements = document.querySelectorAll('[carousel-style]');
  23.  
  24. carouselElements.forEach(element => {
  25. // Replace the value of the carousel-style attribute
  26. const currentStyle = element.getAttribute('carousel-style');
  27. const newStyle = currentStyle.replace(/max-height:\s*\d+px;/, 'max-height: 100%;');
  28. element.setAttribute('carousel-style', newStyle);
  29. });
  30. }
  31.  
  32. // Execute the function after the page loads
  33. window.addEventListener('load', modifyCarouselStyle);
  34.  
  35. // Execute the function periodically every 500 milliseconds
  36. setInterval(modifyCarouselStyle, 500);
  37. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址