tor-browser

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

feature-policy-with-cross-origin-subresource.html (850B)


      1 <html>
      2 <body>
      3 <script src="/common/get-host-info.sub.js"></script>
      4 <script>
      5 
      6 // This test checks if browser attaches the device-memory client hint in the
      7 // HTTP request headers --- while requesting it from 3P context after
      8 // settings feature policy to allow it; with Accept-CH coming from a sticky
      9 // source.
     10 
     11 // echo-client-hints-received.py sets the response headers depending on the set
     12 // of client hints it receives in the request headers.
     13 
     14 fetch(get_host_info()["HTTPS_REMOTE_ORIGIN"] + "/client-hints/accept-ch-stickiness/resources/echo-client-hints-received.py").then(r => {
     15  if(r.status == 200 && r.headers.has("device-memory-received") && r.headers.has("device-memory-deprecated-received")) {
     16    window.top.opener.postMessage('PASS', '*');
     17  }
     18  else {
     19    window.top.opener.postMessage('FAIL', '*');
     20  }
     21 });
     22 
     23 </script>
     24 </body>
     25 </html>