summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/support/iframe-that-tries-to-navigate-parent-and-sends-result-to-grandparent.html
blob: 4b8930de42ff5455a17185afc9d7923025a066a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
<!DOCTYPE html>
<p>This is a frame that tries to navigate its parent.</p>
<script>
window.onload = function() {
  try {
    parent.location.href = "data:text/html,\u003c!DOCTYPE html\u003e\u003cp\u003eIf this message appears, then this frame has been navigated by its child.\u003c/p\u003e\u003cscript\u003eparent.postMessage('can navigate', '*');\u003c/script\u003e";
  } catch(e) {
    parent.parent.postMessage("can not navigate", "*");
  }
}
</script>