Group Map Preview

Fixes U-M previews in groups

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Group Map Preview
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Fixes U-M previews in groups
// @author       Electro
// @match        https://tagpro.koalabeast.com/groups/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // Set this to "true" if its still not working for you.
    const USE_PROXY = false;

    setInterval(() => {
        if(document.querySelector("[name='map']").innerText.includes("MapId:")){
            let mapID = document.querySelector("[name='map']").innerText.replace("MapId:", "").trim();
            let link = `http://unfortunate-maps.jukejuice.com/static/thumbs/${mapID}.png`;
            if(USE_PROXY) link = `https://parretlabs.xyz:8006/proxy?link=${link}&isBlob=1&type=image/png`;

            document.querySelector(".responsive.map-preview").setAttribute("src", link);
        }
    }, 1000);
    // Your code here...
})();