tor-browser

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

first-interaction-not-softnav.tentative.html (1075B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <meta charset="utf-8" />
      5    <script src="/resources/testharness.js"></script>
      6    <script src="/resources/testharnessreport.js"></script>
      7    <script src="/resources/testdriver.js"></script>
      8    <script src="/resources/testdriver-vendor.js"></script>
      9    <script src="resources/soft-navigation-helper.js"></script>
     10  </head>
     11  <body>
     12    <main id="main">
     13      <p><a id="firstlink">Click me!</a></p>
     14      <p><a id="secondlink">Then click me!</a></p>
     15    </main>
     16    <script>
     17      testSoftNavigation({
     18        testName: "first interaction before a soft navigation",
     19        clickTarget: document.getElementById("secondlink"),
     20        extraSetup: async (t) => {
     21          if (test_driver) {
     22            const firstlink = document.getElementById("firstlink");
     23            const clickPromise = new Promise((r) => {
     24              firstlink.addEventListener("click", r, { once: true });
     25            });
     26            test_driver.click(firstlink);
     27            await clickPromise;
     28          }
     29        },
     30      });
     31    </script>
     32  </body>
     33 </html>