<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test JS</title>
  </head>
  <body>
    <pre id="json_el"></pre>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
  <script src="/static/js/detectors.js"></script>
  <script src="/static/js/utils.js"></script>
  <script>
    url = new URL("{{ context.url }}");
    function redirect() {window.location.href = "{{ context.url }}";}
    (function(d) {

      stylizePreElements = function() {
        var preElements = document.getElementsByTagName("pre");
        for (i = 0; i < preElements.length; ++i) {
          var preElement = preElements[i];
          preElement.className += "prettyprint";
        }
      };

      injectPrettifyScript = function() {
        var scriptElement = document.createElement('script');
        scriptElement.setAttribute("src", "https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js");
        document.head.appendChild(scriptElement);
      };

      stylizePreElements();
      injectPrettifyScript();

      let data = {};
      data["detectGPU"] = detectGPU();
      data["isMobileByScreen"] = isMobileByScreen();
      data["detectScreen"] = detectScreen();
      data["getNetworkInfo"] = getNetworkInfo();
      data["getNavigatorData"] = getNavigatorData();
      data["calculateCPUspeed"] = calculateCPUspeed();

      document.getElementById("json_el").innerHTML = JSON.stringify(data, null, 2);
    })(document)
    // Можно обфусцировать дело
    // window.history.pushState("object or string", "Title", url.pathname);
    //
  </script>
</body>
</html>
