mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
5a9fa69c6d
Fixes #27887
30 lines
674 B
HTML
30 lines
674 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<title>Device orientation test</title>
|
|
</head>
|
|
|
|
<body>
|
|
<script>
|
|
window.result = 'Was not oriented';
|
|
window.alpha = undefined;
|
|
window.beta = undefined;
|
|
window.gamma = undefined;
|
|
window.absolute = undefined;
|
|
|
|
document.addEventListener('deviceorientation', onOrientation, false);
|
|
document.addEventListener('deviceorientationabsolute', onOrientation, false);
|
|
|
|
function onOrientation(event) {
|
|
window.result = 'Oriented';
|
|
window.alpha = event.alpha;
|
|
window.beta = event.beta;
|
|
window.gamma = event.gamma;
|
|
window.absolute = event.absolute;
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|