tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

iframe-keyboard-map-helper.html (461B)


      1 <!DOCTYPE html>
      2 <script>
      3 'use strict';
      4 
      5 window.onmessage = message => {
      6  if (message.data === 'Ready') {
      7    let onSuccess = () => { parent.postMessage('Failure', '*'); };
      8    let onError = error => {
      9      if (error.name == 'SecurityError') {
     10        parent.postMessage('Success', '*');
     11      } else {
     12        parent.postMessage('Failure', '*');
     13      }
     14    };
     15 
     16    navigator.keyboard.getLayoutMap().then(onSuccess, onError).catch(onError);
     17  }
     18 };
     19 
     20 </script>