mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Implement window.close and window.closed
This commit is contained in:
parent
ae130822a0
commit
aa1df95b31
Notes:
github-actions[bot]
2024-10-06 00:43:21 +00:00
Author: https://github.com/trflynn89
Commit: aa1df95b31
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1644
Reviewed-by: https://github.com/shannonbooth ✅
7 changed files with 86 additions and 6 deletions
15
Tests/LibWeb/Text/input/HTML/Window-close.html
Normal file
15
Tests/LibWeb/Text/input/HTML/Window-close.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const newWindow = window.open("about:blank", "_blank");
|
||||
|
||||
newWindow.addEventListener("beforeunload", () => {
|
||||
println(`window.closed = ${newWindow.closed}`);
|
||||
done();
|
||||
});
|
||||
|
||||
println(`window.closed = ${newWindow.closed}`);
|
||||
newWindow.close();
|
||||
println(`window.closed = ${newWindow.closed}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue