Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /soft-navigation-heuristics/multiple-nested-events.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/soft-navigation-helper.js"></script>
</head>
<body>
<a id=link>Click me!</a>
<main id=main></main>
<script>
testSoftNavigation({
testName: "Test multiple nested navigate events",
pushState: () => new Promise(resolve => {
// navigate event fires synchronously, so we have to set up event
// handler then call pushState.
navigation.addEventListener("navigate", () => {
navigation.addEventListener("navigate", () => {
resolve();
}, { once: true });
history.pushState({}, '', 'two.html');
}, { once: true });
history.pushState({}, '', 'one.html');
}),
pushUrl: 'two.html',
});
</script>
</body>
</html>