tor-browser

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

iframe-TAO-crossorigin-port.sub.html (1034B)


      1 <!DOCTYPE html>
      2 <html>
      3 <body>
      4 <script>
      5    const url = '{{location[scheme]}}://{{host}}:{{ports[http][1]}}/resource-timing/resources/TAOResponse.py?tao=origin_port_{{ports[http][1]}}';
      6    const observe = (list, observer) => {
      7        const entry = list.getEntries()[0];
      8        const sum = entry.redirectStart +
      9                  entry.redirectEnd +
     10                  entry.domainLookupStart +
     11                  entry.domainLookupEnd +
     12                  entry.connectStart +
     13                  entry.connectEnd +
     14                  entry.secureConnectionStart +
     15                  entry.requestStart +
     16                  entry.responseStart +
     17                  entry.transferSize +
     18                  entry.encodedBodySize +
     19                  entry.decodedBodySize;
     20 
     21        const result = sum == 0 ? 'PASS' : 'FAIL';
     22        window.top.postMessage(result, '*');
     23    }
     24    let observer = new PerformanceObserver(observe);
     25    observer.observe({ entryTypes: ["resource"] });
     26    fetch(url).then(r => r.text());
     27 </script>
     28 </body>
     29 </html>