tor-browser

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

docload_wnd.html (874B)


      1 <html>
      2 <head>
      3  <title>Accessible events testing for document</title>
      4  <script>
      5    const STATE_BUSY = Ci.nsIAccessibleStates.STATE_BUSY;
      6 
      7    var gService = null;
      8    function waitForDocLoad() {
      9      if (!gService) {
     10        gService = Cc["@mozilla.org/accessibilityService;1"].
     11         getService(Ci.nsIAccessibilityService);
     12      }
     13 
     14      var accDoc = gService.getAccessibleFor(document);
     15 
     16      var state = {};
     17      accDoc.getState(state, {});
     18      if (state.value & STATE_BUSY) {
     19        window.setTimeout(waitForDocLoad, 0);
     20        return;
     21      }
     22 
     23      hideIFrame();
     24    }
     25 
     26    function hideIFrame() {
     27      var iframe = document.getElementById("iframe");
     28      gService.getAccessibleFor(iframe.contentDocument);
     29      iframe.style.display = "none";
     30    }
     31  </script>
     32 </head>
     33 
     34 <body onload="waitForDocLoad();">
     35  <iframe id="iframe"></iframe>
     36 </body>
     37 </html>