Screen orientation
Reads portrait or landscape and angle.
In one line
Can check whether your screen is portrait or landscape and its angle
Reads portrait or landscape and angle.
Shows how the phone or tablet is held and whether a laptop screen is rotated.
What it can and can't do
What the user does: Nothing. It happens when the page loads or you rotate the device.
It can
- Check portrait or landscape
- Check the rotation angle
- Notice when you rotate the device
It cannot
- See the device's tilt or movement
- Rotate your screen for you
- See how you hold the device when rotation is locked
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 38 | 2014-10-07 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 43 | 2015-12-15 | None |
| Safari | Supported | 16.4 | 2023-03-27 | None |
| Safari on iPhone | Supported | 16.4 | 2023-03-27 | None |
| Chrome on Android | Supported | 39 | 2014-11-12 | None |
| Samsung Internet | Supported | 4.0 | 2016-03-11 | None |
How a site asks for it
| API | screen.orientation.type, angle |
| Browser compat keys | api.Screen.orientation |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Script reads the value
- Value joins the fingerprint payload
Data you get
What comes back: Screen orientation
Shape: enum
How often: on rotate
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
type | enum | None | portrait-primary and others | Not listed |
angle | integer | degrees | 0, 90, 180, 270 | Not listed |
Technical limits
- Not a motion sensor
The story
What it is
Reads whether the screen is portrait or landscape, and the angle.
For you
You turn your phone and the page rearranges. The angle can be 0, 90 or 180 degrees. You never see the reading.
For makers
Makers use it to reshape layouts. It is also a quick way to tell a real phone from a desktop browser faking one, because real phones rotate and desktops do not.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game switches from a tall menu to a wide play field when you turn your phone. | None named |
| video | A video page goes full screen when you rotate to landscape. | YouTube |
| maps | A web map moves its search bar and info card when you rotate. | Google Maps |
| shopping | A store shows more of each photo in landscape on tablets. | None named |
| security | A fraud check sees motion from a phone with an angle that never changes, which can mean an emulator. | None named |
| education | A reading app switches to a two page spread in landscape on tablets. | None named |
Risks
- Mild fingerprint clue
- Hints at device type
What the platform says
- MDN: Screen Orientation API. Documents how a page can read the orientation and angle of the screen.
Good uses and abuse
Legitimate uses
- Adapt layout
Known abuse
- Fingerprint input
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 2 | Rough identifying entropy, when known |
A real example: LinkedIn
Collector key(s): screenOrientation.
Related capabilities
Related
- APFC / DNA device fingerprint (abuse prevention features). Can collect about 48 device traits and send them in secret with later requests
Sources
How well checked: Based on official documentation.