ladybird/Tests/LibWeb/Text/input/navigation/run-script-before-iframe-initial-navigation.html
2024-04-11 18:41:20 +02:00

17 lines
657 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<body>
<!-- Other browsers seem to display the message below regardless of what src is (valid or not) -->
<iframe id="target" srcdoc="iframe content"></iframe>
<script>
asyncTest((done) => {
const script = target.contentDocument.createElement("script");
script.innerHTML = `parent.postMessage("message from test iframe", "*");`;
target.contentDocument.body.appendChild(script);
window.addEventListener("message", event => {
println(event.data);
done();
});
});
</script>
</body>