Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

680 B
Raw Blame
<!DOCTYPE html>
<html lang="en">

<head>
  <title>Device motion test</title>
</head>

<body>
  <script>
    window.result = 'Was not moved';
    window.acceleration = undefined;
    window.accelerationIncludingGravity = undefined;
    window.rotationRate = undefined;
    window.interval = undefined;

    document.addEventListener('devicemotion', onMotion, false);

    function onMotion(event) {
      window.result = 'Moved';
      window.acceleration = event.acceleration;
      window.accelerationIncludingGravity = event.accelerationIncludingGravity;
      window.rotationRate = event.rotationRate;
      window.interval = event.interval;
    }
  </script>
</body>

</html>