From bb3d76117a8031d3bb29101c6443e546e664e8a1 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Mon, 12 Oct 2026 10:21:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(mirror):=20=E5=8F=B3=E4=B8=8B=E8=A7=92?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BE=BD=E6=A0=87=EF=BC=88=E5=8C=85=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20+=20=E4=BB=8E=E6=A8=A1=E5=9D=97=E6=BA=90=E7=A0=81?= =?UTF-8?q?=E8=AF=BB=E5=87=BA=E7=9A=84=20HORNET-TAG=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 加载器记录 __hornetPackVersion__ 并渲染固定徽标;TAG 用正则从 __modules__[87072] 源码读取,避免手写常量与真实包不一致。 --- 3dtank.com/play/static/js/main.9f4e7a89.js | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/3dtank.com/play/static/js/main.9f4e7a89.js b/3dtank.com/play/static/js/main.9f4e7a89.js index 665465e..f49567e 100644 --- a/3dtank.com/play/static/js/main.9f4e7a89.js +++ b/3dtank.com/play/static/js/main.9f4e7a89.js @@ -16,6 +16,7 @@ const __pack_files__ = await (async () => { return null; } const __pack__ = await __pack_resp__.json(); + window.__hornetPackVersion__ = __pack__.version || ''; console.log('[Hornet] 单包已载入: ' + (__pack__.count || 0) + ' 个文件 版本=' + __pack__.version); return __pack__.files || null; } catch (__pack_err__) { @@ -68,6 +69,30 @@ if (__missing__.length) { var __webpack_modules__ = window.__modules__; +// ===== 版本徽标(右下角):包版本 + 从模块源码读出的 HORNET-TAG ===== +// 目的:一眼确认「当前页面吃的是哪一版」,消灭"改了没生效 / 版本没换"这类排查干扰。 +// TAG 是从 window.__modules__[87072] 的源码里正则读出来的(不是手写常量),所以它不会说谎。 +try { + const __TagSrc__ = String((window.__modules__ && window.__modules__[87072]) || ''); + const __TagM__ = __TagSrc__.match(/HORNET-TAG:\s*([^\r\n*]+)/); + const __BadgeText__ = + 'Hornet 包 ' + (window.__hornetPackVersion__ || '?') + '\n' + (__TagM__ ? __TagM__[1].trim() : '(未找到 HORNET-TAG)'); + const __AddBadge__ = () => { + try { + if (document.getElementById('__hornet_badge__')) return; + const El = document.createElement('div'); + El.id = '__hornet_badge__'; + El.style.cssText = + 'position:fixed;right:6px;bottom:6px;z-index:2147483647;padding:4px 8px;border-radius:4px;' + + 'background:rgba(0,0,0,.66);color:#7fe7a1;font:12px/1.45 Consolas,Menlo,monospace;pointer-events:none;white-space:pre'; + El.textContent = __BadgeText__; + (document.body || document.documentElement).appendChild(El); + } catch (e) {} + }; + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', __AddBadge__); + else __AddBadge__(); +} catch (e) {} + // ===== 原 webpack runtime (一字未改) ===== ;var __webpack_module_cache__={};function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var i=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(t,n)=>{for(var i in n)__webpack_require__.o(n,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.p="/play/",__webpack_require__(76074),__webpack_require__(13431),__webpack_require__(26482);var __webpack_exports__=__webpack_require__(78231); // ===== 暴露 webpack require(hornet 工具链 hook_gamemode/hornet_lib 依赖)=====