Web App Manifest: orientation support
Published
The manifest orientation member sets the default screen orientation an
installed web app launches and runs in, such as portrait or landscape, unless
the page locks a different orientation itself at runtime.
Browser & ecosystem support
Section titled “Browser & ecosystem support”- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop) | Yes | 39 | high | source | — |
| Chrome (Android) | Yes | 39 | high | source | 1 |
| Edge (Desktop) | Yes | 79 | high | source | 2 |
| Firefox (Desktop) | No | — | high | source | 3 |
| Firefox (Android) | Yes | 79 | high | source | — |
| Safari (macOS) | No | — | high | source | 4 |
| Safari (iOS) | No | — | high | source | 56 |
| Samsung Internet | Yes | 4.0 | high | source | 7 |
| WebView (Android) | Yes | 39 | high | source | 8 |
- Derived by browser-compat-data mirroring from Chrome.
- Derived by browser-compat-data mirroring from Chrome.
- No Firefox support is recorded in browser-compat-data.
- No Safari support is recorded in browser-compat-data.
- No Safari on iOS support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Safari.
- Derived by browser-compat-data mirroring from Chrome Android.
- Derived by browser-compat-data mirroring from Chrome Android.
How to use it
Section titled “How to use it”Declare the member in the web app manifest with one of the spec’s keyword values:
{ "name": "Field Notes", "start_url": "/", "display": "standalone", "orientation": "portrait"}How to detect it at runtime
Section titled “How to detect it at runtime”MDN separately documents the Screen Orientation API, whose lock() method a
page can feature-detect before calling:
function supportsOrientationLock() { return 'orientation' in screen && typeof screen.orientation.lock === 'function';}
async function lockLandscape() { if (!supportsOrientationLock()) return; try { await screen.orientation.lock('landscape'); } catch {}}Practical checklist
Section titled “Practical checklist”- Per the spec,
orientationsets the default orientation for all top-level traversables of the web app; a requested value’s support is conditional on the user agent honoring it. - MDN documents that if the member is omitted or set to an invalid value, the app will typically use the device’s natural orientation plus any user or system-level orientation settings.
- Per the spec, a user agent may support the manifest
orientationmember without implementing the separate Screen Orientation API — the two are independent capabilities. - Omitting
orientationis valid — per MDN, apps that work well in either orientation can simply leave it out.
Where to go next
Section titled “Where to go next”← Back to the Compatibility explorer.