tor-browser

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

export.js (1237B)


      1 const client_hints_list = [
      2  "device-memory",
      3  "dpr",
      4  // "width", (only available for images)
      5  "viewport-width",
      6  "rtt",
      7  "downlink",
      8  "ect",
      9  "sec-ch-ua",
     10  "sec-ch-ua-arch",
     11  "sec-ch-ua-platform",
     12  "sec-ch-ua-model",
     13  "sec-ch-ua-mobile",
     14  "sec-ch-ua-full-version",
     15  "sec-ch-ua-platform-version",
     16  "sec-ch-prefers-color-scheme",
     17  "sec-ch-prefers-reduced-motion",
     18  "sec-ch-ua-bitness",
     19  "sec-ch-viewport-height",
     20  "sec-ch-device-memory",
     21  "sec-ch-dpr",
     22  // "sec-ch-width", (Only available for images)
     23  "sec-ch-viewport-width",
     24  "sec-ch-ua-full-version-list",
     25  "sec-ch-ua-wow64",
     26  "sec-ch-prefers-reduced-transparency",
     27 ];
     28 
     29 const client_hints_full_list = client_hints_list.concat(["width", "sec-ch-width"])
     30 
     31 const default_on_client_hints = [
     32  "sec-ch-ua",
     33  "sec-ch-ua-mobile",
     34  "sec-ch-ua-platform",
     35 ];
     36 
     37 const iframe_src =
     38    "/client-hints/resources/expect-client-hints-headers-iframe.py?";
     39 
     40 const expect_iframe_no_hints = iframe_src +
     41    client_hints_list.map((e) => {
     42      if(default_on_client_hints.includes(e)) {
     43        return e+"=true";
     44      } else {
     45        return e+"=false";
     46      }
     47    }).join("&");
     48 
     49 const expect_iframe_hints = iframe_src +
     50    client_hints_list.map(e => e+"=true").join("&");