tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

no-prefetch-for-post.https.html (926B)


      1 <!DOCTYPE html>
      2 <meta name="timeout" content="long">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/dispatcher/dispatcher.js"></script>
      6 <script src="/common/utils.js"></script>
      7 <script src="../resources/utils.js"></script>
      8 <script src="resources/utils.sub.js"></script>
      9 <script>
     10  setup(() => assertSpeculationRulesIsSupported());
     11 
     12  promise_test(async t => {
     13    let agent = await spawnWindow(t);
     14    let nextUrl = agent.getExecutorURL({ executor: 'post-navigation-handler.py', protocol: 'https', page: 2 });
     15    await agent.forceSinglePrefetch(nextUrl);
     16 
     17  await agent.execute_script(async (nextUrl) => {
     18    window.executor.suspend(() => {
     19        navigate_by_form_generated_post(nextUrl);
     20    });
     21  }, [nextUrl]);
     22 
     23    assert_not_prefetched(await agent.getRequestHeaders());
     24  }, "post navigations should not use cached prefetch");
     25 </script>