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/navigation-unload-cross-origin.sub.window.html - WPT Dashboard Interop Dashboard
// META: title=Cross-origin navigation started from unload handler must be ignored
// META: script=../resources/helpers.js
promise_test(async () => {
const iframe = await addIframe();
iframe.contentWindow.addEventListener("unload", () => {
iframe.contentWindow.location.href = "//{{hosts[][www]}}/common/blank.html?fail";
});
iframe.src = "/common/blank.html?pass";
await waitForIframeLoad(iframe);
assert_equals(iframe.contentWindow.location.search, "?pass");
});