test: wait for beforeunload handler to be installed (#23874)
This commit is contained in:
parent
fbf397e15d
commit
5918dd6e65
7 changed files with 24 additions and 26 deletions
14
spec-main/fixtures/api/beforeunload-empty-string.html
Normal file
14
spec-main/fixtures/api/beforeunload-empty-string.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// Only prevent unload on the first window close
|
||||
var unloadPrevented = false;
|
||||
window.onbeforeunload = function() {
|
||||
if (!unloadPrevented) {
|
||||
unloadPrevented = true;
|
||||
return '';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue