history-back-and-forward-should-not-work-in-fenced-tree-inner.html (1758B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="utils.js"></script> 4 <title>history-back-and-forward-should-not-work-in-fenced-tree-inner</title> 5 6 <body> 7 <script> 8 // This is a helper file that will serve as the document loaded inside 9 // a fenced frame by 'history-back-and-forward-should-not-work-in-fenced 10 // -tree' Once loaded, it will sequentially perform the back and forward 11 // history navigations to observe whether these methods were successfuly 12 // restricted for the fenced tree. 13 14 const [history_navigation_performed_key, outer_page_ready_key, 15 embed_scope] = parseKeylist(); 16 17 (async function () { 18 const url = new URL(location.href); 19 const test = url.searchParams.get("test"); 20 21 writeValueToServer(history_navigation_performed_key, "yes"); 22 23 // Execute history.back() within fenced frame and iframe. 24 await nextValueFromServer(outer_page_ready_key); 25 window.history.back(); 26 writeValueToServer(history_navigation_performed_key, "yes"); 27 28 // Execute history.forward() within fenced frame and iframe. 29 await nextValueFromServer(outer_page_ready_key); 30 window.history.forward(); 31 writeValueToServer(history_navigation_performed_key, "yes"); 32 33 if (embed_scope === "outerPage::fencedFrame::iframe") return; 34 35 const iframe = document.createElement('iframe'); 36 const iframe_embed_scope = "outerPage::fencedFrame::iframe"; 37 iframe.src = generateURL( 38 "history-back-and-forward-should-not-work-in-fenced-tree-" + 39 "inner.html", 40 [history_navigation_performed_key, outer_page_ready_key, 41 iframe_embed_scope]); 42 document.body.append(iframe); 43 })(); 44 </script> 45 </body>