From f6117cbc5f756bb4c1207b3fd8039a82349d12b3 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sun, 14 Jun 2026 11:12:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8D=E8=A2=AB=E8=AF=AF?= =?UTF-8?q?=E5=88=A0=E7=9A=84=20scripts.forEach(function(code){=20(3?= =?UTF-8?q?=E5=A4=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/web_panel/home.html | 2 +- static/web_panel/js/app.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/web_panel/home.html b/static/web_panel/home.html index 58f3395..fa5894b 100644 --- a/static/web_panel/home.html +++ b/static/web_panel/home.html @@ -79,6 +79,6 @@ - + diff --git a/static/web_panel/js/app.js b/static/web_panel/js/app.js index c4df3df..08594cd 100644 --- a/static/web_panel/js/app.js +++ b/static/web_panel/js/app.js @@ -124,6 +124,7 @@ async function loadPage(pageName) { var cleanHtml = html.replace(/]*>([\s\S]*?)<\/script>/gi, function(m,code){ scripts.push(code.trim()); return ''; }); content.innerHTML = cleanHtml; + scripts.forEach(function(code){ try { var s=document.createElement('script'); s.textContent=code; document.head.appendChild(s); document.head.removeChild(s); } catch(ex){ console.error('Inline script error:', ex); } }); @@ -186,6 +187,7 @@ async function loadPluginPage(pluginName) { content.style.padding = '0'; content.innerHTML = '
'+clean+'
'; + scripts.forEach(function(code){ try { var s=document.createElement('script'); s.textContent=code; document.head.appendChild(s); document.head.removeChild(s); } catch(ex){ console.error('Plugin script error:', ex); } }); @@ -251,6 +253,7 @@ window.pickPath = function(mode, callback) { var clean = html.replace(/]*>([\s\S]*?)<\/script>/gi, function(m,code){ scripts.push(code.trim()); return ''; }); contentArea.innerHTML = clean; // Execute scripts + scripts.forEach(function(code){ try { var s=document.createElement('script'); s.textContent=code; document.head.appendChild(s); document.head.removeChild(s); } catch(ex){} });