tor-browser

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

crossiframe-childframe.html (1108B)


      1 <!DOCType html>
      2 <html>
      3 <body>
      4 <script src=event-timing-test-utils.js></script>
      5 <div style="width: 300px; height: 300px" id='iframe_div' onmousedown="mainThreadBusy(120)">
      6 <script>
      7 (async () => {
      8  const observerPromise = new Promise(resolve => {
      9    new PerformanceObserver(entryList => {
     10      const mouseDowns = entryList.getEntriesByName('mousedown');
     11      if (mouseDowns.length === 0)
     12        return;
     13      resolve(mouseDowns);
     14    }).observe({ type:'event' });
     15  });
     16  const entries = await observerPromise;
     17  const clickDone = performance.now();
     18  if (entries.length !== 1) {
     19    top.postMessage("failed", "*");
     20    return;
     21  }
     22  const entry = entries[0];
     23  top.postMessage({
     24    // Entry values (|entry| itself is not clonable)
     25    "name": entry.name,
     26    "cancelable": entry.cancelable,
     27    "entryType": entry.entryType,
     28    "startTime": entry.startTime,
     29    "processingStart": entry.processingStart,
     30    "processingEnd": entry.processingEnd,
     31    "duration": entry.duration,
     32    // Other values
     33    "clickDone" : clickDone,
     34    "target": entry.target.id,
     35  }, '*');
     36 }) ();
     37 </script>
     38 </body>
     39 </html>