tor-browser

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

activeelement-after-focusing-same-site-iframe-outer.html (925B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <title>activeElement when focusing same-site iframe</title>
      4 <script>
      5 let log = "";
      6 function getLog() {
      7    return log;
      8 }
      9 window.onmessage = function(e) {
     10    log += e.data;
     11 };
     12 window.onload = function() {
     13    log += "outeronload,";
     14    log += "activeElement:" + document.activeElement.tagName + ",";
     15    log += "willfocusiframe,";
     16    document.getElementsByTagName("iframe")[0].focus();
     17    log += "didfocusiframe,";
     18    log += "activeElement:" + document.activeElement.tagName + ",";
     19    log += "willbluriframe,";
     20    document.getElementsByTagName("iframe")[0].blur();
     21    log += "didbluriframe,";
     22    log += "activeElement:" + document.activeElement.tagName + ",";
     23    log += "willspineventloop,"
     24    opener.step_timeout(function() {
     25        opener.postMessage(getLog(), "*");
     26    }, 1500);
     27 }
     28 </script>
     29 <iframe src="activeelement-after-focusing-same-site-iframe-inner.html"></iframe>