Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /portals/xfo/portals-xfo-sameorigin.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<body>
<script>
async_test(t => {
assert_implements("HTMLPortalElement" in self);
var portal = document.createElement('portal');
portal.src = get_host_info().HTTP_REMOTE_HOST + "/portals/xfo/resources/xfo-sameorigin.asis";
portal.onmessage = t.unreached_func("should not have received a message");
document.body.appendChild(portal);
t.add_cleanup(() => portal.remove());
t.step_timeout(() => t.done(), 2000);
}, "`XFO: SAMEORIGIN` blocks cross-origin portals.");
</script>
</body>