debug: add WriteDebugLog after postToIframe to confirm delivery

This commit is contained in:
mirivlad 2026-06-08 12:31:45 +08:00
parent f892d377a0
commit c03e2e2961
3 changed files with 10 additions and 5 deletions

View File

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

View File

@ -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}))