summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fs/resources/message-target.html
blob: cdd86bcc663f623ceea00eb80d552b3da4f3442d (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>
<script src='test-helpers.js'></script>
<script src='messaging-serialize-helpers.js'></script>
<script src='message-target.js'></script>
<script id="inline_script">
  'use strict'

  if (window.parent !== null && window.parent != window) {
    window.parent.postMessage('LOADED', { targetOrigin: '*' });
  }

  if (window.opener !== null) {
    window.opener.postMessage('LOADED', { targetOrigin: '*' });
  }

  // Use an undefined message target to send responses to
  // MessageEvent::source instead.
  const target = undefined;

  add_message_event_handlers(
    /*receiver=*/self, target, /*target_origin=*/'*');
</script>