Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / chrome / test / data / referrer_policy / referrer-policy-start.html
blobac580fac797cc671cf8e7aedb54f245f35b73429
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function run() {
6 var kPolicy = 1;
7 var kPort = 2;
8 var kSslPort = 3;
9 var kRedirect = 4;
10 var kLink = 5;
11 var kTarget = 6;
12 var re = new RegExp("policy=(.*)&port=(.*)&ssl_port=(.*)&redirect=(.*)&" +
13 "link=(.*)&target=(.*)");
14 var matches = re.exec(document.location.search);
16 if (matches == null) {
17 document.body.innerText = "Could not parse parameters!";
18 return;
21 if (matches[kPolicy] != "no-meta") {
22 var meta = document.createElement("meta");
23 meta.name = "referrer";
24 meta.content = matches[kPolicy];
25 document.head.appendChild(meta);
28 var destination;
30 if (matches[kRedirect] == "none") {
31 destination = "http://127.0.0.1:" + matches[kPort] +
32 "/files/referrer-policy-log.html";
33 } else if (matches[kRedirect] == "http2http") {
34 destination = "http://127.0.0.1:" + matches[kPort] +
35 "/server-redirect?http://127.0.0.1:" + matches[kPort] +
36 "/files/referrer-policy-log.html";
37 } else if (matches[kRedirect] == "http2https") {
38 destination = "http://127.0.0.1:" + matches[kPort] +
39 "/server-redirect?https://127.0.0.1:" + matches[kSslPort] +
40 "/files/referrer-policy-log.html";
41 } else if (matches[kRedirect] == "https2http") {
42 destination = "https://127.0.0.1:" + matches[kSslPort] +
43 "/server-redirect?http://127.0.0.1:" + matches[kPort] +
44 "/files/referrer-policy-log.html";
45 } else if (matches[kRedirect] == "echoheader") {
46 destination = "http://127.0.0.1:" + matches[kPort] + "/echoheader?Referer";
49 if (matches[kLink] == "true") {
50 var link = document.createElement("a");
51 link.innerText = "link";
52 link.target = matches[kTarget];
53 link.href = destination;
54 document.body.appendChild(link);
55 } else {
56 document.location = destination;
59 </script>
60 </head>
61 <body onload="run()">
62 </body>
63 </html>