Outpost with Mini Boss Map v2

Embeds a mini boss map into the Outpost page’s left margin cell

当前为 2025-04-28 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Outpost with Mini Boss Map v2
// @namespace    Zega
// @version      1.1
// @description  Embeds a mini boss map into the Outpost page’s left margin cell
// @match        https://fairview.deadfrontier.com/onlinezombiemmo/index.php*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
  'use strict';

  // Wait for everything to load
  window.addEventListener('load', () => {
    // Find the left-margin <td> by its background image URL
    const allTds = document.querySelectorAll('td.design2010');
    let mapTd = null;
    allTds.forEach(td => {
      const bg = window.getComputedStyle(td).backgroundImage;
      if (bg && bg.includes('left_margin.jpg')) {
        mapTd = td;
      }
    });

    if (!mapTd) {
      console.warn('Mini Boss Map: could not find left-margin <td>');
      return;
    }

    // Make sure children can be absolutely positioned
    mapTd.style.position = 'relative';

    // Create and style the iframe
    const iframe = document.createElement('iframe');
    iframe.src = 'https://www.dfprofiler.com/bossmap';
    Object.assign(iframe.style, {
      position:        'absolute',
      top:             '10px',
      right:           '10px',
      width:           '750px',
      height:          '1050px',
      border:          '2px solid #444',
      borderRadius:    '8px',
      boxShadow:       '0 0 8px rgba(0,0,0,0.5)',
      backgroundColor: '#fff',
      zIndex:          '999'
    });

    mapTd.appendChild(iframe);
    console.log('Mini Boss Map: iframe appended');
  });
})();