<!DOCTYPE html>
<script>
  window.addEventListener("portalactivate", function(e) {
    var bc = new BroadcastChannel("portals-host-hidden-after-activation");
    bc.postMessage({ hasHost: !!window.portalHost });
    bc.close();
  });

  var bc = new BroadcastChannel("portals-host-hidden-after-activation");
  bc.postMessage({hasHost: !!window.portalHost });
  bc.close();

  window.portalHost.postMessage("loaded");
</script>
