tor-browser

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

config-cross-origin-apis-inner.https.html (1158B)


      1 <!DOCTYPE html>
      2 <script src="utils.js"></script>
      3 <script src="/common/get-host-info.sub.js"></script>
      4 <title>Fenced frame attribution reporting self navigation test</title>
      5 
      6 <body>
      7 <script>
      8 // This helper function will navigate a fenced frame to a remote origin page.
      9 // It will then check to make sure that window.fence APIs are not allowed after
     10 // the navigation.
     11 const [key] = parseKeylist();
     12 
     13 if (location.origin == get_host_info().ORIGIN) {
     14  const configs = window.fence.getNestedConfigs();
     15  const next_url = getRemoteOriginURL(generateURL(
     16      "config-cross-origin-apis-inner.https.html", [key]));
     17  location.href = next_url;
     18 } else {
     19  const event = {
     20    eventType: "reserved.top_navigation_commit",
     21    eventData: "data!",
     22    destination: ["buyer"],
     23  }
     24 
     25  // These should gracefully fail without badmessaging the renderer.
     26  window.fence.setReportEventDataForAutomaticBeacons(event);
     27  window.fence.reportEvent(event);
     28 
     29  const configs = window.fence.getNestedConfigs();
     30 
     31  // Report how many configs were obtained. Cross-origin pages should not
     32  // obtain any nested configs.
     33  writeValueToServer(key, configs.length);
     34 }
     35 
     36 </script>
     37 </body>