summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/portals/resources/portal-embed-and-activate.html
blob: 04f15b7fda43d873b52f63a80565c2ae4a9a7f50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<!--
  Embeds a portal (src specified by query parameter "url") and activates it after
  receiving a message from the portal.
-->
</title>
<body>
  <script>
    var searchParams = new URL(location).searchParams;
    let portal = document.createElement("portal");
    portal.src = searchParams.get("url");
    portal.onmessage = () => { portal.activate(); }
    document.body.appendChild(portal);
  </script>
</body>