debug: add WriteDebugLog after postToIframe to confirm delivery

This commit is contained in:
2026-06-08 12:31:45 +08:00
parent f892d377a0
commit c03e2e2961
3 changed files with 10 additions and 5 deletions
@@ -28,9 +28,12 @@
// Post message to iframe (queue if not ready)
function postToIframe(msg) {
console.log('[CalendarPluginPage] postToIframe: iframeReady=' + iframeReady + ', hasEl=' + !!iframeEl + ', hasCW=' + !!(iframeEl?.contentWindow))
if (iframeEl && iframeEl.contentWindow && iframeReady) {
console.log('[CalendarPluginPage] postToIframe: sending msg.type=' + msg.type)
iframeEl.contentWindow.postMessage(msg, '*')
} else {
console.log('[CalendarPluginPage] postToIframe: queuing msg.type=' + msg.type)
messageQueue.push(msg)
}
}
@@ -111,6 +114,8 @@
events,
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) {}
} catch (e) {
console.error('[CalendarPluginPage] loadCalendarData:', e)
console.log('[CalendarPluginPage] error details:', JSON.stringify({message: String(e), stack: e?.stack}))