Replace GIFs on globalpixel.xyz

Replace all GIFs with the name ua.gif on globalpixel.xyz

当前为 2023-12-30 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Replace GIFs on globalpixel.xyz
// @namespace    http://tampermonkey.net/
// @version      0.3
// @license MIT
// @description  Replace all GIFs with the name ua.gif on globalpixel.xyz
// @author       th3b3lg
// @match        https://globalpixel.xyz/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to replace GIFs
    function replaceGIFs() {
        // Get all images on the page
        var images = document.getElementsByTagName('img');

        // Loop through each image
        for (var i = 0; i < images.length; i++) {
            // Check if the image source contains 'ua.gif'
            if (images[i].src.includes('ua.gif')) {
                // Replace the image source
                images[i].src = 'https://coffeesource.thetemmie.repl.co/ua.gif';
            }
        }
    }

    // Create a MutationObserver to detect changes in the DOM
    var observer = new MutationObserver(replaceGIFs);

    // Options for the observer (in this case, we're observing changes to the subtree)
    var observerConfig = { subtree: true, childList: true };

    // Start observing the target node for configured mutations
    observer.observe(document.body, observerConfig);

    // Replace GIFs on page load
    replaceGIFs();
})();