From 7eb1b1846da13c18c7e73d83fc1c0b2d9e7494b8 Mon Sep 17 00:00:00 2001 From: woohoo Date: Mon, 11 Jul 2022 19:02:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wuhu-torn-helper.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wuhu-torn-helper.js b/wuhu-torn-helper.js index d571b3e..f421c43 100644 --- a/wuhu-torn-helper.js +++ b/wuhu-torn-helper.js @@ -10307,5 +10307,16 @@ z-index:100001; return JSON.parse(document.querySelector('#sidebar_data').innerHTML) } + /** + * 遍历所有子节点 + * @param {Node} node 需要遍历的容器父元素 + * @param {Function} handler 调用的方法 + */ + function walkNode(node, handler) { + let list = node.childNodes; + if (list.length === 0) handler(node); + else list.forEach(n => walkNode(n, handler)); + } + $zhongNode.initTimer.innerHTML = `助手加载时间 ${Date.now() - start_timestamp}ms`; }(); \ No newline at end of file