tor-browser

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

scroll-on-synthetic-event.html (698B)


      1 <!doctype html>
      2 <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <body>
      6 <script>
      7 promise_test(async t => {
      8  // We need to grab an NavigationDestination to construct the event.
      9  navigation.onnavigate = t.step_func_done(e => {
     10    const event = new NavigateEvent("navigate", {
     11      destination: e.destination,
     12      signal: (new AbortController()).signal
     13    });
     14 
     15    assert_throws_dom("SecurityError", () => event.scroll());
     16  });
     17  history.pushState(1, null, "#1");
     18 }, "scroll: scroll() should throw if invoked on a synthetic event.");
     19 </script>
     20 </body>