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-form-submit.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#navigating-across-documents">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<iframe id="i" src="navigation-unload-form-submit-1.html"></iframe>
<script>
var test = async_test('Tests that navigation during an unload caused by a form submit does nothing');
window.onload = test.step_func(function() {
var i = document.querySelector('#i');
window.finishedLoading = test.step_func_done(function () {
assert_equals(i.contentWindow.location.pathname.split('/').pop(), 'navigation-unload-form-submit-2.html');
assert_equals(i.contentWindow.location.hash, '');
});
i.contentWindow.document.querySelector('input[type="submit"]').click();
});
</script>