Disable GIF autoplay in TweetDeck

See https://yal.cc/tweetdeck-no-gif-autoplay/

// ==UserScript==
// @name         Disable GIF autoplay in TweetDeck
// @namespace    http://yal.cc
// @version      1.0
// @description  See https://yal.cc/tweetdeck-no-gif-autoplay/
// @author       YellowAfterlife
// @match        https://tweetdeck.twitter.com/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    setInterval(function() {
        var nodes = document.querySelectorAll(".js-media-preview-container.is-gif:not(.cc_yal_tweetdeck_gif_autopause)");
        for (var i = 0; i < nodes.length; i++) {
            var node = nodes[i];
            if (!node.classList.contains("is-manually-paused") && !node.parentElement.classList.contains("detail-preview")) {
                var pauseButton = node.querySelector(".gif-pause");
                if (!pauseButton) continue;
                pauseButton.click();
                if (!node.classList.contains("is-manually-paused")) continue;
            }
            node.classList.add("cc_yal_tweetdeck_gif_autopause");
        }
    }, 500);
})();

QingJ © 2025

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