summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/portals/resources/portal-host-post-message-after-activate.html
blob: 7b03ac0294ced6f2ef6b01fbc91876d82b829b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<script>
  window.portalHost.postMessage("loaded");

  var ph = window.portalHost;

  window.onportalactivate = e => {
    var exception_name = ""
    try {
      ph.postMessage("message");
    }
    catch (error) {
      exception_name = error.name;
    }
    bc = new BroadcastChannel("portal-host-post-message-after-activate");
    bc.postMessage(exception_name, "*");
    bc.close();
  };
</script>