12 /policy=(.*)&port=(.*)&ssl_port=(.*)&redirect=(.*)&link=(.*)&target=(.*)/);
13 var matches = re.exec(document.location.search);
15 if (matches == null) {
16 document.body.innerText = "Could not parse parameters!";
20 var meta = document.createElement("meta");
21 meta.name = "referrer";
22 meta.content = matches[kPolicy];
23 document.head.appendChild(meta);
27 if (matches[kRedirect] == "true") {
29 "https://127.0.0.1:" + matches[kSslPort] + "/server-redirect?" +
30 "http://127.0.0.1:" + matches[kPort] + "/files/referrer-policy-log.html";
33 "http://127.0.0.1:" + matches[kPort] + "/files/referrer-policy-log.html";
36 if (matches[kLink] == "true") {
37 var link = document.createElement("a");
38 link.innerText = "link";
39 link.target = matches[kTarget];
40 link.href = destination;
41 document.body.appendChild(link);
43 document.location = destination;