This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
burgernotes-web/static/iframe.html

28 lines
755 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>iFrame Container</title>
</head>
<body>
<iframe style="width: 100%; height: 100%; border: none;" id="messageContainer" sandbox="allow-same-origin allow-scripts"></iframe>
<script>
function receiveMessage(event) {
if (event.origin !== location.origin) {
return;
}
document.getElementById('messageContainer').contentWindow.document;
iframeDocument.open();
iframeDocument.write(event.data);
iframeDocument.close();
}
// Listen for messages from the parent window
window.addEventListener('message', receiveMessage, false);
</script>
</body>
</html>