Screen Orientation & Lock

The Screen Orientation API allows web applications to get the information about the current orientation of the document (portrait or landscape) as well as to lock the screen orientation in a requested state.

API glimpse

Returns the current screen orientation type as one of portrait-primary, portrait-secondary (upside down), landscape-primary and landscape-secondary (upside down).
window.screen.orientation.addEventListener('change', listener)
An event fired when the document orientation has changed.
Requests a screen lock in the lockType specified. Returns a Promise resolved when the lock was acquired successfully.
Removes previously acquired screen orientation lock.