Skip to Content
Platform.Ontology

Screen Orientation lock

Forces the screen into portrait or landscape.

Does something on your deviceHardware and accessoriesDisplay hardwareWeb browsersWhile you use it

In one line

Can lock your screen to portrait or landscape, but only in full screen

Forces the screen into portrait or landscape.

Controls how the person holds the phone. It reads nothing, but it can trap a page in one orientation.

What it can and can't do

What the user does: You tap Full screen or open an installed web app, then start a game or video.

It can

  • Lock the screen to portrait or landscape
  • Unlock it again when you leave full screen
  • Work in installed web apps on Android

It cannot

  • Lock the screen unless the page is full screen or installed on Android
  • Work in Safari, including on iPhone
  • Stay locked after you leave the page
  • Override your phone's own rotation lock in every case

How it differs between platforms: Android Chrome and Edge allow it in full screen. Safari and iPhone do not.

Browser support

BrowserStatusFirst versionReleasedNote
ChromePartial382014-10-07Always throws <code>NotSupportedError</code>.
EdgePartial792020-01-15Always throws <code>NotSupportedError</code>.
FirefoxSupported1442025-10-14None
SafariNot supportedNot availableNot listedNone
Safari on iPhoneNot supportedNot availableNot listedNone
Chrome on AndroidSupported382014-10-08None
Samsung InternetSupported3.02015-04-10None

How a site asks for it

APIscreen.orientation.lock('landscape'), unlock(), screen.orientation.type
Browser compat keysapi.ScreenOrientation.lock
How access is grantedgesture
What the user seesNo prompt; page must be fullscreen on Chrome Android (or installed PWA)
Needs a secure context (HTTPS)Yes
Needs a user gestureYes
How long it lastsPer origin
How to take it backSite settings
Inside an iframeSame as top level; cross-origin iframes need a permissions policy where listed

Typical flow

  1. Call the API
  2. Browser applies its access rules
  3. Page receives the result

Data you get

What comes back: Forces the screen into portrait or landscape.
Shape: object
How often: on demand

FieldTypeUnitRangePrecision
typeenumNoneportrait-primary, portrait-secondary, landscape-primary, landscape-secondaryNot listed
angleintegerdegrees0, 90, 180, 270Not listed

Technical limits

  • Fullscreen or installed PWA required on Chrome
  • No effect on desktop
  • iOS Safari does not implement lock()

The story

What it is

A page can force your screen to stay in portrait or landscape.

For you

You go full screen in a game or video and the phone flips to landscape and stays there, even if you tilt it.

For makers

Makers use it for games and video where one way up is better. It reads nothing from you, but it can trap you in one view if misused.

Where you see it

TypeExampleApps
gamesA browser racing game locks to landscape so steering with tilt works.None named
gamesCloud gaming on a phone browser forces landscape for the controls.Xbox Cloud Gaming, GeForce NOW
videoA video player locks to landscape when you go full screen.YouTube, Netflix
creativeA camera tool keeps a photo in the right direction.None named
productivityA web document scanner keeps pages upright.None named
adsA sneaky ad forces landscape to fill the screen.None named

Risks

  • Trapped orientation
  • Not on iPhone

What the platform says

Good uses and abuse

Legitimate uses

  • Games
  • Video players
  • Camera tools

Known abuse

  • Orientation trap

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction1 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2014, Chrome 38: lock() ships on Android, fullscreen only
  • 2026, Firefox 144: Firefox ships lock()
  • Vibration. Can buzz the phone in a pattern, after you have tapped on the page

Sources

How well checked: Checked against real behavior.

On this page