<script>
  try {
    window.screen.orientation.addEventListener("change", () => {
      parent.window.postMessage(screen.orientation.type, "*");
    });
  } catch (err) {
    parent.window.postMessage(err.message, "*");
  }
</script>
