<!DOCTYPE html>
<script>
'use strict';

window.onmessage = message => {
  if (message.data === 'Ready') {
    let onSuccess = () => { parent.postMessage('Success', '*'); };
    let onError = error => {
      parent.postMessage('Failure', '*');
    };

    navigator.keyboard.getLayoutMap().then(onSuccess, onError).catch(onError);
  }
};

</script>
