<!DOCTYPE html>
<html>
<head>
<title>Check that the referrer header is correct</title>
</head>
<body>
<div id="console"></div>
<script>
var log = document.querySelector("#console");
var result;
if (document.referrer == "")
result = "FAIL: no referrer";
else if (document.referrer.indexOf(".html") !== -1)
result = "FAIL: referrer contains more than just the origin";
else
result = "PASS";
log.innerText = result;
document.title = result;
</script>
</body>
</html>