GitHub logo

Device Screen Orientation Web Test

This page makes a test 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, the page should detect screen orientation change and display the current state.
  2. Try to change the screen orientation programmatically by clicking the buttons with the desired screen orientation. Please note that your device may support only some orientation types. Probably it will not work if you're not in fullscreen mode.
  3. Try clicking the 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