Fixed kokoro loading process.

This commit is contained in:
2025-04-07 06:51:45 +00:00
parent 0842cbfefc
commit b1387f4833
13 changed files with 905 additions and 789 deletions
+7 -3
View File
@@ -281,16 +281,20 @@
<script>
// Redefine console.log to expose browser logs to model
const originalLog = console.log;
console.log = function(message) {
console.log = function(...args) {
if (typeof debug !== 'undefined' && debug) {
const debugContent = document.getElementById('debug-content');
if (debugContent) {
const logMsg = document.createElement('div');
logMsg.textContent = message;
// Convert all arguments to string and join them
logMsg.textContent = args.map(arg =>
typeof arg === 'object' ? JSON.stringify(arg) : String(arg)
).join(' ');
debugContent.appendChild(logMsg);
}
}
originalLog(message);
// Pass all arguments to the original console.log
originalLog.apply(console, args);
};
</script>
<script type="module" src="/js/loader.js"></script>