summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html
blob: 2135011d9c68824ce0281d6541a39b0e7bf07b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!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>' +
    // eslint-disable-next-line no-useless-concat
    '<script>window.opener.postMessage("DONE", "*");</' + 'script>' +
    '</body>');
  document.close();
}, { once: true });
</script>
</body>