fix: 恢复被误删的 scripts.forEach(function(code){ (3处)
This commit is contained in:
@@ -124,6 +124,7 @@ async function loadPage(pageName) {
|
||||
var cleanHtml = html.replace(/<script\b[^>]*>([\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 = '<div class="plugin-page-root"><style>'+styles+'</style>'+clean+'</div>';
|
||||
|
||||
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(/<script\b[^>]*>([\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){}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user