Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset="utf-8">
<title>A frame inside a data: frame can request origin-keying</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script type="module">
import { testGetter } from "./resources/helpers.mjs";
promise_setup(async () => {
const childURL = "https://{{hosts[][www]}}:{{ports[https][0]}}/html/browsers/origin/origin-keyed-agent-clusters/resources/send-oac-header.py?header=?1";
const iframe = document.createElement("iframe");
iframe.src = "data:text/html," + encodeURIComponent(`<iframe src="${childURL}"></iframe>`);
const loaded = new Promise(resolve => iframe.onload = resolve);
document.body.append(iframe);
await loaded;
});
// The frame's top-level creation URL is this page's, which is potentially trustworthy, so the
// frame is in a secure context and its origin-keying request is honored.
testGetter(() => frames[0].frames[0], true, "frame in data: frame");
</script>