tor-browser

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

file_focus_design_mode_inner.html (614B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>activeElement design-mode inner document</title>
      6 </head>
      7 <body>
      8 <h1>Inner</h1>
      9 <script>
     10 let innerlog = "innerlog:";
     11 
     12 document.designmode = "on";
     13 
     14 window.onmessage = function(e) {
     15  if (e.data == "focus") {
     16    document.documentElement.focus();
     17  } else if (e.data == "getlog") {
     18    innerlog += "activeElement:" + document.activeElement.tagName + ",";
     19    parent.postMessage(innerlog, "*");
     20  }
     21 };
     22 
     23 window.onfocus = function() {
     24  innerlog += "windowfocus,";
     25 };
     26 
     27 window.onblur = function() {
     28  innerlog += "windowblur,";
     29 };
     30 </script>
     31 </body>
     32 </html>