debug: log typeof events and JSON.stringify in both parent and iframe

This commit is contained in:
mirivlad 2026-06-08 13:57:45 +08:00
parent 82c2588449
commit 21130c6f1e
4 changed files with 4 additions and 6 deletions

View File

@ -19,7 +19,7 @@
background: #13131f;
}
</style>
<script type="module" crossorigin src="/assets/main-CznV1dRA.js"></script>
<script type="module" crossorigin src="/assets/main-CRc6HR9x.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-B1PBee3I.css">
</head>
<body>

View File

@ -481,7 +481,7 @@ body {
return;
}
try {
appEl.innerHTML = '<div class="test-msg">IT WORKS! events=' + (state.events ? state.events.length : 0) + ' cats=' + (state.categories ? state.categories.length : 0) + '</div>';
appEl.innerHTML = '<div class="test-msg">IT WORKS! events=' + (state.events ? state.events.length : 0) + ' cats=' + (state.categories ? state.categories.length : 0) + '<br>eventsType=' + typeof state.events + '<br>json=' + JSON.stringify(state.events).substring(0,100) + '</div>';
try { window.parent.go.main.App.WriteDebugLog('[iframe] innerHTML SET SUCCESSFULLY'); } catch(e) {}
} catch(e) {
try { window.parent.go.main.App.WriteDebugLog('[iframe] innerHTML error: ' + String(e)); } catch(e2) {}

View File

@ -115,9 +115,7 @@
categories,
})
// Confirm delivery via Go log
try { window.go.main.App.WriteDebugLog('[CalendarPluginPage] calendar-data sent to iframe, events=' + events.length + ', categories=' + (categories?.length || 0)) } catch(e) {
try { window.go.main.App.WriteDebugLog('[CalendarPluginPage] ERROR in WriteDebugLog: ' + String(e) + ' | eventsRaw=' + String(eventsRaw) + ' | typeof eventsRaw=' + typeof eventsRaw + ' | typeof events=' + typeof events + ' | events===' + JSON.stringify(events)) } catch(e2) {}
}
try { window.go.main.App.WriteDebugLog('[CalendarPluginPage] calendar-data sent to iframe, events.len=' + events.length + ', categories.len=' + (categories?.length || 0) + ', typeof events=' + typeof events + ', typeof eventsRaw=' + typeof eventsRaw + ', eventsRaw.length=' + eventsRaw.length + ', eventsRaw.substr(0,10)=' + String(eventsRaw).substring(0,10)) } catch(e) {}
} catch (e) {
console.error('[CalendarPluginPage] loadCalendarData:', e)
console.log('[CalendarPluginPage] error details:', JSON.stringify({message: String(e), stack: e?.stack}))