navigation-api-forward.tentative.html (1251B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Detect navigation.forward()</title> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/resources/testdriver.js"></script> 9 <script src="/resources/testdriver-vendor.js"></script> 10 <script src="resources/soft-navigation-helper.js"></script> 11 </head> 12 <body> 13 <a id=link>Click me!</a> 14 <main id=main> 15 </main> 16 <script> 17 window.onload = async () => { 18 // Wait for after the load event so that the navigation doesn't get converted 19 // into a replace navigation. 20 await new Promise(r => step_timeout(r, 0)); 21 22 navigation.onnavigate = e => { 23 e.intercept(); 24 }; 25 // Push a couple of navigation entries, then go back so that we'd have a 26 // navigation entry to go forward to. 27 await navigation.navigate("other.html").finished; 28 await navigation.navigate("foobar.html").finished; 29 await navigation.back().finished; 30 31 testSoftNavigation({ 32 testName: "`navigation.forward()` properly works with SoftNavigationHeuristics", 33 pushState: async () => { 34 await navigation.forward().committed; 35 }, 36 }); 37 }; 38 </script> 39 </body> 40 </html>