mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 16:11:54 +00:00
The following classes are in the HTML spec and thus belong in the HTML namespace: * BeforeUnloadEvent * HTMLFormControlsCollection * RadioNodeList
20 lines
588 B
HTML
20 lines
588 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(done => {
|
|
const iframe = document.createElement("iframe");
|
|
document.body.appendChild(iframe);
|
|
|
|
iframe.contentWindow.addEventListener("beforeunload", e => {
|
|
println("Before unload event fired");
|
|
e.preventDefault();
|
|
println(`Default prevented: ${e.defaultPrevented}`);
|
|
});
|
|
|
|
iframe.addEventListener("load", e => {
|
|
println(`iframe load: ${e.target.src}`);
|
|
done();
|
|
});
|
|
|
|
iframe.src = "about:blank";
|
|
});
|
|
</script>
|