Browse Source

Update frontend/javascript/index.js

Co-authored-by: qodo-merge-for-open-source[bot] <189517486+qodo-merge-for-open-source[bot]@users.noreply.github.com>
sstidl 3 tuần trước cách đây
mục cha
commit
3a0e6b37f0
1 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 12 1
      frontend/javascript/index.js

+ 12 - 1
frontend/javascript/index.js

@@ -331,7 +331,18 @@ function startRenderingLoop() {
 
       // Set user's IP and provider
       if (testState.testData.clientIp) {
-        privacyWarning.innerHTML = `<span>You are connected through:</span><br/>${testState.testData.clientIp}`;
+        // Clear previous content
+        privacyWarning.innerHTML = '';
+
+        const connectedThrough = document.createElement('span');
+        connectedThrough.textContent = 'You are connected through:';
+  
+        const ipAddress = document.createTextNode(testState.testData.clientIp);
+
+        privacyWarning.appendChild(connectedThrough);
+        privacyWarning.appendChild(document.createElement('br'));
+        privacyWarning.appendChild(ipAddress);
+  
         privacyWarning.classList.remove("hidden");
       }