Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/sections/LibreDBDemo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ const { class: className = '' } = Astro.props;

// The two bundles listen for different messages and each ignores the
// other's, so both forms go out and the loaded clip picks up its own.
// Both clips are served from our own origin, so the messages are addressed
// there rather than to '*' — nothing is delivered to a frame that some
// other document has managed to navigate elsewhere.
const send = (frame, verb) => {
const win = frame.contentWindow;
if (!win) return;
win.postMessage(`libredb-demo:${verb}`, '*');
win.postMessage({ type: `om-demo-${verb}` }, '*');
win.postMessage(`libredb-demo:${verb}`, window.location.origin);
win.postMessage({ type: `om-demo-${verb}` }, window.location.origin);
};

const load = (frame, clip) => {
Expand Down
Loading