1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
content / test / data / before_unload_same_doc_nav.html [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<!--
On a mobile viewport we need to make sure the page does not stretch beyond the
size of the viewport to avoid displaying a scroll bar.
-->
<meta name="viewport" content="width=device-width,minimum-scale=1">
<html>
<body></body>
<script>
onbeforeunload = (event) => {
history.pushState(null, '', `#foo`);
};
</script>
<style>
body {
background-color:#0000FF;
overflow: scroll;
}
#foo {
position: relative;
height: 100vh;
}
</style>
<div id="foo"></div>
</html>