tor-browser

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

iframe-that-opens-modals.html (429B)


      1 <!DOCTYPE html>
      2 <script>
      3 function openModal(name) {
      4    switch (name) {
      5    case "alert":
      6        return alert("MESSAGE");
      7    break;
      8    case "confirm":
      9        return confirm("MESSAGE?");
     10    break;
     11    case "prompt":
     12        return prompt("MESSAGE:", "DEFAULT VALUE");
     13    break;
     14    case "print":
     15        return print();
     16    break;
     17  }
     18 }
     19 
     20 onmessage = function(e) {
     21    parent.postMessage(openModal(e.data), "*");
     22 }
     23 </script>