From d236302b0985bbe594f3a24b480b00b67b41b172 Mon Sep 17 00:00:00 2001 From: NetworkCats Date: Sun, 22 Mar 2026 11:58:44 +0800 Subject: [PATCH] fix: skip alt-IP detection when querying another IP address The detectAltIp() function was unconditionally fetching the viewer's own IPv6/IPv4 address and displaying it alongside queried IP results. Pass the is_query flag to the client via a data attribute and guard the alt-IP detection so it only runs when viewing your own IP. --- static/script.js | 4 +++- templates/index.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/script.js b/static/script.js index abd2d27..c28ab68 100644 --- a/static/script.js +++ b/static/script.js @@ -320,5 +320,7 @@ function initCopyIp(wrap){ } } - detectAltIp(); + if(!root.hasAttribute("data-is-query")){ + detectAltIp(); + } })(); diff --git a/templates/index.html b/templates/index.html index fbf590f..8796e8b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -67,6 +67,7 @@

{{ ip }}