summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html
blob: 0603894279407aeae891bf5b603378fd34cab148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML>
<body>
<script>
function syncXHR() {
  let xhr = new XMLHttpRequest();
  xhr.open("GET", window.location, false);
  xhr.send(null);
}

addEventListener('load', evt => {
  syncXHR();
  document.open();
  document.write(
    '<body>' +
    '<iframe src="about:blank"></iframe>' +
    '<script>window.opener.postMessage("DONE", "*");</' + 'script>' +
    '</body>');
  document.close();
}, { once: true });
</script>
</body>