fuckRegionTelepo

No More 陆行鸟 火爆

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         fuckRegionTelepo
// @match        https://ff14bjz.sdo.com/RegionKanTelepo
// @run-at       document-start
// @description  No More 陆行鸟 火爆
// @version      0.0.1
// @license      MIT
// @namespace https://greasyfork.org/users/1548623
// ==/UserScript==

(function () {
  const script = document.createElement('script');
  script.textContent = `
    (function () {
      const originalFetch = window.fetch;
      //console.log('[PAGE] fetch hook installed');

      window.fetch = async function (...args) {
        const resp = await originalFetch.apply(this, args);

        try {
          const input = args[0];
          const url = input instanceof Request ? input.url : input;

          // 命中目标 API
          if (typeof url === 'string' && url.includes('queryGroupListTravelTarget')) {
            //console.log('[PAGE] target fetch hit:', url);

            const clone = resp.clone();
            const text = await clone.text();

            //console.log('[PAGE] raw response:', text);

            const json = JSON.parse(text);

            if (
              json &&
              json.data &&
              typeof json.data.groupList === 'string'
            ) {
              const list = JSON.parse(json.data.groupList);

              if (Array.isArray(list)) {
                list.forEach(g => {
                  if (g.state === 2 || g.state === 1) {
                    g.state = 0; // <===
                  }
                });

                json.data.groupList = JSON.stringify(list);

                //console.log('[PAGE] modified groupList:', list);

                return new Response(JSON.stringify(json), {
                  status: resp.status,
                  headers: resp.headers
                });
              }
            }
          }
        } catch (e) {
          //console.error('[PAGE] fetch hook error:', e);
        }

        return resp;
      };
    })();
  `;

  document.documentElement.appendChild(script);
  script.remove();
})();