Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-window-open.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/context-helper.js"></script>
<script>
window.scriptToRun =
'relevantWindow.open("target.html", "target");';
async_test(t => {
window.addEventListener("message", t.step_func_done(function(e) {
// Base URL used for parsing a relative URL to `target.html`
// should be the base URL of the entry settings object in
assert_equals(
e.data.location,
new URL('target.html', entryUrl).href,
'Base URL should use the entry settings object');
// `document.referrer` should reflect the source browsing context,
// which is the entry in
assert_equals(
e.data.referrer, entryUrl,
'Referrer should use the entry settings object');
}));
}, 'Fetch client and URL resolution for window.open()');
</script>
<iframe id="entry" src="entry/entry.html"></iframe>