tor-browser

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

iframe-activeelement-after-focusing-out-same-site-iframes-outer.html (907B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <title>iframe active element after focusing out same site iframes outer</title>
      4 <input></input></br>
      5 <iframe src="iframe-activeelement-after-focusing-out-iframes-inner.html"></iframe>
      6 <script>
      7 let outerlog = "outerlog:";
      8 
      9 let input = document.querySelector("input");
     10 let iframe = document.querySelector("iframe");
     11 window.onmessage = function(e) {
     12  if (e.data == "ready") {
     13    opener.postMessage("ready", "*");
     14  } else if (e.data == "focus") {
     15    outerlog += "willfocusinput,";
     16    input.focus();
     17    outerlog += "didfocusinput,";
     18  } else if (e.data == "getlog") {
     19    iframe.contentWindow.postMessage("getlog", "*");
     20  } else {
     21    opener.postMessage(outerlog + e.data, "*");
     22  }
     23 };
     24 
     25 window.onload = function() {
     26  window.onfocus = function() {
     27    outerlog += "windowfocus,";
     28  };
     29 
     30  window.onblur = function() {
     31    outerlog += "windowblur,";
     32  };
     33 };
     34 </script>