navigate-by-name-reporting-helper.html (1705B)
1 <!DOCTYPE html> 2 <script src="utils.js"></script> 3 <title>Navigate reporting helper</title> 4 <!-- This document is used as a helper by `../navigate-by-name.html`. That test 5 attempts to navigate various frames all named `target_frame`, to this 6 document. All of these navigations should fail, due to the frames being 7 unreachable to the initiator (because of the "fence" of the fenced frame). 8 As a result, this document should always load in a new top-level 9 "outermost" pop-up window. 10 --> 11 12 <script> 13 const [navigation_success_key] = parseKeylist(); 14 15 // We're currently using `window.opener` as a proxy for "did this load in a new 16 // outermost popup window?". Note that if we try and test navigations initiated 17 // from inside a fenced frame and they open up in a new outermost popup, there 18 // will be no opener by default (crbug.com/1250694) so using `window.opener` as 19 // a signal will be insufficient. In order to test anchor navigations to this 20 // document from within a fenced frame, we'll need a better signal for 21 // outermost-ness. We should consider adding a value to `document.loadingMode` 22 // for fenced frames: 23 // https://wicg.github.io/nav-speculation/prerendering.htmlprerendering.html#browsing-context-loading-mode. 24 // 25 // Alternatively if we really want to detect if this loaded inside a fenced 26 // frame, we could just remove the opt-in headers and then implementations that 27 // support fenced frame opt-ins would timeout if they somehow don't honor the 28 // fence on named frame navigations, but that's not a very good outcome. 29 if (window.opener) { 30 writeValueToServer(navigation_success_key, "PASS"); 31 } else { 32 writeValueToServer(navigation_success_key, "FAIL"); 33 } 34 </script>