GitHub logo

Device Screen Orientation Web Test

This page tests if your browser can report active device screen orientation and if it's possible to change and lock the screen orientation programmatically with JS. We use two methods to obtain lock: old deprecated function screen.lockOrientation (and screen.mozLockOrientation, screen.msLockOrientation if available) and new function ScreenOrientation.lock .

How to test?

  1. Rotate your device in hands, the page should detect screen orientation change and display current state.
  2. Try to change the screen orientation programmatically by clicking the buttons with the desired screen orientation. Please note that not all orientation types may be supported by your device. Probably it will not work if you're not in fullscreen mode.
  3. Try clicking fullscreen mode button. Most modern browsers require fullscreen mode activated to allow rotations.
  4. Try different browsers. The results can vary a lot.
  5. Install the website as an app (PWA) and try the previous steps.

Source code and test instructions are in GitHub.

Browser fullscreen mode is  
Select orientation to change and lock