<script>
  'use strict';

  window.onload = function() {
    navigator.contacts.select(['name', 'email'], { multiple: true })
      .then(results => parent.postMessage({ errorMsg: '' }, '*'))
      .catch(exception => parent.postMessage({ errorMsg: exception.name }, '*'));
  }
</script>
