summaryrefslogtreecommitdiffstats
path: root/docshell/test/iframesandbox/file_top_navigation_by_user_activation.html
blob: 8454f1fac4dc11d55d3f83f0c7f6aab93e17759d (plain)
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
27
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test window for top navigation with user activation</title>
<script>
window.onload = () => {
  opener.postMessage("READY", "*");
};

window.onhashchange = () => {
  opener.postMessage("NAVIGATED", "*");
};

window.onmessage = (e) => {
  if (e.data == "CLICK" || e.data == "SCRIPT") {
    frames[0].postMessage([e.data, location.href + "#hash"], "*");
  } else {
    opener.postMessage(e.data, "*");
  }
};
</script>
</head>
<body>
  <iframe sandbox="allow-scripts allow-top-navigation-by-user-activation" src="http://example.org/tests/docshell/test/iframesandbox/file_top_navigation_by_user_activation_iframe.html"></iframe>
</body>
</html>