<script>
  function handleEvent(e) {
    var conf = window.prompt('Prompt Dialog');
    if (conf == null) {
      window.parent.postMessage('pass', '*');
    } else {
      window.parent.postMessage('fail', '*');
    }
  }
  window.addEventListener('message', handleEvent);
</script>
