Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /referrer-policy/generic/inheritance/iframe-inheritance-data.html - WPT Dashboard Interop Dashboard
<html>
<head>
<title>Referrer Policy: iframes with data url uses no referrer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="resources/make-html-script.js"></script>
<meta name="referrer" content="origin">
</head>
<body onload="runTest()">
<h1>Referrer Policy: iframes with data url uses no referrer</h1>
<script>
let test = async_test("iframes with data url uses no referrer");
window.addEventListener("message", test.step_func_done(msg => {
assert_equals(msg.data.referrer, undefined);
}));
function runTest() {
let iframe = document.createElement("iframe");
iframe.src = `data:text/html,${createScriptString(get_host_info().REMOTE_ORIGIN)}`;
document.body.appendChild(iframe);
}
</script>
<div id="log"></div>
</body>
</html>