summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/permissions-policy/experimental-features/resources/vertical-scroll-wheel-block.html
blob: 21fc2b9b3914a8dfc23515ff5b663d4a1c6f2d30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<style>
  body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
  }
</style>
<body>
  <p>This page blocks all 'mouse-wheel'.</p>
<script>
  function defaultScroll() {
    window.scrollTo(0, 0);
  }

  document.body.addEventListener(
      "wheel",
      (e) => { e.preventDefault(); defaultScroll(); }, {passive: false});

  defaultScroll();
</script>
</body>