Screen orientation lockLimited availability
The screen.orientation.lock() method prevents changes to the screen orientation, typically in fullscreen applications such as games. For example, while locked, rotating a phone to the side won't change the screen orientation from landscape to portrait.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
✕Not supportedup to 155
Current: 155Edge
✕Not supportedup to 154
Current: 154Firefox
1–143Not supported
144+Supportedsince Oct 14, 2025
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–37Not supported
38+Supportedsince Oct 8, 2014
Current: 155Firefox Android
4–143Not supported
144+Supportedsince Oct 14, 2025
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Chrome, Edge, Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: lock.
Feature detection
JS · check before using
if ("ScreenOrientation" in globalThis && "lock" in ScreenOrientation.prototype) {
// ScreenOrientation.lock is available
}Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| ScreenOrientation.lock | ✕ | ✕ | 144 | ✕ | 38 | 144 | ✕ |
| ScreenOrientation.unlock | ✕ | ✕ | 144 | ✕ | 38 | 144 | ✕ |