summaryrefslogtreecommitdiffstats
path: root/browser/components/search/test/browser/telemetry/searchTelemetry_redirect_with_js.html
blob: 744fcd29064d3845447673ce7aa01d8bacddfb88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!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>Page will redirect using the url param</title>
    <script>
      let parentWindow = window.parent;
      let params = new URLSearchParams(window.location.search);
      let paramValue = params.get("url");
      if (paramValue) {
        // Replicate how some SERPs load pages by encoding the true destination
        // in the query param value.
        let url = paramValue.startsWith("https://") ?
          new URL(paramValue).href :
          new URL(paramValue, "https://example.org/").href;
        window.location.href = url;
      }
    </script>
  </head>
  <body>
    <h1>Redirecting...</h1>
  </body>
</html>