From 42b3592ed906d737612c887afe42b91f1b55cfd6 Mon Sep 17 00:00:00 2001 From: LukeMackin Date: Tue, 21 Jul 2026 18:26:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20H5=E7=83=AD=E6=9B=B4=E6=96=B0=E4=B8=8D?= =?UTF-8?q?=E5=86=8Ddocument.write=E9=81=BF=E5=85=8D=E5=8F=8C=E9=87=8D?= =?UTF-8?q?=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - localStorage命中时只更新版号+徽章,不重写页面 - 嵌入式按钮始终可见,可持续检查更新 --- .../client-android/android/app/src/main/assets/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/client-android/android/app/src/main/assets/index.html b/packages/client-android/android/app/src/main/assets/index.html index f637327..31169d3 100644 --- a/packages/client-android/android/app/src/main/assets/index.html +++ b/packages/client-android/android/app/src/main/assets/index.html @@ -45,7 +45,10 @@ function applyUpdate(){ (function(){ var b=localStorage.getItem('gca_html'),v=localStorage.getItem('gca_ver'); if(b&&v&&v!==document.getElementById('ver').innerText){ - document.open();document.write(b);document.close() + // Show badge but don't rewrite page (avoids double-render) + var el=document.createElement('span');el.className='badge';el.style.cssText='background:#22c55e;color:#000'; + el.innerText='CACHED v'+v.replace('0.1.0-dav-android-','');document.querySelector('h1').appendChild(el); + document.getElementById('ver').innerText=v } })();