tor-browser

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

html_har_post-data-test-page.html (1421B)


      1 <!-- Any copyright is dedicated to the Public Domain.
      2     http://creativecommons.org/publicdomain/zero/1.0/ -->
      3 
      4 <!doctype html>
      5 
      6 <html>
      7  <head>
      8    <meta charset="utf-8"/>
      9    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
     10    <meta http-equiv="Pragma" content="no-cache" />
     11    <meta http-equiv="Expires" content="0" />
     12    <title>Network Monitor Test Page</title>
     13  </head>
     14 
     15  <body>
     16    <p>HAR POST data test</p>
     17 
     18    <script type="text/javascript">
     19      /* exported executeTest, executeTest2, executeTest3 */
     20      "use strict";
     21 
     22      function post(address, data) {
     23        const xhr = new XMLHttpRequest();
     24        xhr.open("POST", address, true);
     25        xhr.setRequestHeader("Content-Type", "application/json");
     26        xhr.send(data);
     27      }
     28 
     29      function get(address) {
     30        const xhr = new XMLHttpRequest();
     31        xhr.open("GET", address);
     32        xhr.send();
     33      }
     34 
     35      function executeTest() {
     36        const url = "html_har_post-data-test-page.html";
     37        const data = "{'first': 'John', 'last': 'Doe'}";
     38        post(url, data);
     39      }
     40 
     41      function executeTest2(size) {
     42        const url = "html_har_post-data-test-page.html";
     43        const data = "x".repeat(size);
     44        post(url, data);
     45      }
     46 
     47      function executeTest3() {
     48        const url = "html_har_post-data-test-page.html";
     49        get(url);
     50      }
     51 
     52    </script>
     53  </body>
     54 
     55 </html>