prerendered_page.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <html>
  2. <!--
  3. A page that fetches only "prefetch.js" when scanned by NoStatePrefetch, and
  4. fetches "prefetch_meta.js" in addition to that if javascript execution happens
  5. on the page. In all cases the scripts are executed in a blocking manner.
  6. By prefetching this page, a browsertest can verify that javascript was not
  7. executed (prefetch_meta.js should not be requested to load even after the page
  8. has been fully prefetched (or loaded)).
  9. Note: there is no way to ensure that the script loaded via .appendChild() or a
  10. sync XHR happens before a preload-scannable request because preload scanner is
  11. racy and often fetches resources it sees before the inline script has a chance
  12. to execute.
  13. -->
  14. <body>
  15. <script>
  16. var s = document.createElement("script");
  17. s.src = "prefetch_meta.js";
  18. document.body.appendChild(s);
  19. </script>
  20. <!-- Ordering is imporant here because the test harness relies on sequential
  21. parsing of this page. When a fetch request for prefetch.js happens, it can
  22. be safely assumed that the browser has parsed the inline script above. -->
  23. <script src="prefetch.js"></script>
  24. Some content that is necessary for registering paint metrics.
  25. </body>
  26. <head>
  27. <!-- Ordering on the page is important. -->
  28. <title>Prefetch Page</title>
  29. </head>
  30. </html>