Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
WebDesktop/WindowAPI_Test/index.html

27 lines
600 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<iframe src="window.html" width="512" height="512" id="window-frame"></iframe>
<script>
const frame = document.getElementById('window-frame');
frame.addEventListener('load', () => {
});
window.addEventListener('message', (event) => {
if (event.origin !== new URL(frame.src).origin) return;
console.log(event.data);
frame.contentWindow.postMessage({content: 'Test Titel'}, event.origin);
}, false);
</script>
</body>
</html>