Fixed kokoro loading process.
This commit is contained in:
+7
-3
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user