Preview boss area

Preview the area of a boss in the bossmap

当前为 2020-05-22 提交的版本,查看 最新版本

// ==UserScript==
// @name         Preview boss area
// @version      0.1
// @description  Preview the area of a boss in the bossmap
// @author       A Meaty Alt
// @include      /bossmap.dfprofiler.com\/bossmap.php/
// @grant        none
// @namespace https://greasyfork.org/users/150647
// ==/UserScript==

(function() {
    'use strict';
    setInterval(() => {
        const blocks = document.querySelectorAll(".block");
        for (const block of blocks) {
            if (block.textContent && block.textContent.match(/\d+/) !== null) {
                if (block.children.length && block.children[0].tagName === "A") break;
                const [x, y] = block.classList[1].split("_").map((c) => c.substring(1));
                block.innerHTML = `<a style="color: inherit" href="https://deadfrontier.info/w/map/images/Fairview_${x}x${y}.png">${block.innerHTML}</a>`;
            }
        }
    }, 1000);
})();