tor-browser

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

refresh.html (1026B)


      1 <html>
      2  <script>
      3    function setCookie(newVal) {
      4      window.document.cookie = "pageStatus = " + newVal + ";";
      5    }
      6 
      7    function readCookie(name) {
      8      var nameEQ = name + "=";
      9      var ca = document.cookie.split(";");
     10      for (var i = 0; i < ca.length; i++) {
     11        var c = ca[i];
     12        while (c.charAt(0) == " ") c = c.substring(1, c.length);
     13        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
     14      }
     15      return null;
     16    }
     17 
     18    function valSwap() {
     19      currentCookie = readCookie("pageStatus");
     20      if (currentCookie == null) {
     21        setCookie("DEFAULT");
     22      }
     23 
     24      if (currentCookie.localeCompare("REFRESHED") == 0) {
     25        setCookie("DEFAULT");
     26        return "DEFAULT";
     27      }
     28      setCookie("REFRESHED");
     29      return "REFRESHED";
     30    }
     31 
     32    var textToShow = valSwap();
     33    window.addEventListener("DOMContentLoaded", _event => {
     34      document.querySelector("h1").innerHTML = textToShow;
     35    });
     36  </script>
     37  <body>
     38    <h1>DEFAULT</h1>
     39  </body>
     40 </html>