Turning a phone or tablet can transform a page in an instant. Video stretches into landscape, a map gains space, or a reading layout returns to portrait. The Screen Orientation API gives websites a structured way to understand that change and, in limited situations, request that the display remain in a particular orientation. Useful as it is, orientation is still information about your device—and sometimes about how you are holding it.
Screen Orientation API: what websites can learn
The Screen Orientation API exposes two basic ideas: the current orientation state and a way to request an orientation lock. Through screen.orientation, a page can receive a broad type such as portrait-primary or landscape-primary, an angle, and a change event when the screen rotates.
The W3C Screen Orientation specification defines these values and the safety checks around them. It distinguishes orientation from motion sensors: a page does not receive a continuous stream from the gyroscope simply by reading screen orientation. Instead, it gets a coarse description of how the display is arranged.
Orientation is a modest fingerprinting signal
A screen’s natural orientation, current type, and reported angle can help distinguish one device setup from another. On their own, portrait or landscape reveals little. Combined with viewport dimensions, pixel ratio, hardware capabilities, language, and other values, these details can contribute to a browser fingerprint.
The current specification therefore recommends reducing precision in privacy-conscious contexts. A browser may limit exposed types to primary portrait or landscape, normalize angles to zero or ninety degrees, and fire events only when the display crosses between portrait and landscape. Those choices preserve the layout use case without exposing every physical distinction in the device.
Our guide to browser fingerprinting explains why the accumulation matters more than any single signal. The orientation value is not a hidden identity card; it is one more small characteristic a tracker may try to combine.
Hidden pages should not watch you rotate
Modern privacy safeguards restrict when orientation change events are delivered. The document should be fully active, visible at the system level, and associated with a top-level page that has the user’s attention. Hidden tabs, minimized windows, and background documents should not receive a quiet history of every rotation.
This restriction reflects a broader browser principle: information needed for a visible experience should not continue flowing when that experience is out of view. It resembles the limits discussed in our Page Visibility API guide, where background state changes what a site can reasonably do.
Locking orientation is more powerful than reading it
A page can call screen.orientation.lock() to ask for portrait, landscape, a primary orientation, or another supported state. Games, video players, presentation tools, and camera interfaces may have legitimate reasons to keep a stable layout. The request is not guaranteed to succeed.
Browsers can impose pre-lock conditions. A common rule is that the page must already be in a simple fullscreen state, while installed web applications may have different platform conventions. The lock can also fail when the requested orientation is unsupported, the document is not active, or sandbox rules prohibit it. Leaving fullscreen normally removes the orientation lock.
The MDN orientation lock reference notes that support varies and locking is most common on mobile devices. A site should never assume that forcing landscape will work everywhere.
Fullscreen and orientation are separate choices
Orientation locking often depends on fullscreen, but the two APIs do different work. Fullscreen controls how much of the display an element occupies. Orientation lock asks which way the display should remain arranged. If a video player first expands and then locks to landscape, the browser is mediating two related transitions.
Our Fullscreen API guide explains why user activation, browser-owned transition notices, and reliable exit controls matter. If a page enters fullscreen unexpectedly or makes it difficult to return to your preferred orientation, leave the experience and check the domain before continuing.
Accessibility comes before visual convenience
Some people use devices mounted in a fixed position or depend on a particular orientation for accessibility. A page that works only after physical rotation can make essential content unusable. Standards guidance therefore emphasizes that content and functionality should remain available in both orientations unless a specific orientation is genuinely essential.
A responsible site treats orientation lock as an enhancement, not a gate. Controls should remain reachable, text should reflow, and an alternative should exist when the operating system or user preference refuses the lock. Browser-level rotation settings may also reflect a deliberate accessibility choice and should not be treated as a problem to work around.
Practical orientation privacy habits
- Use orientation locks only on sites and apps you intentionally opened.
- Exit fullscreen if a page becomes difficult to control or shows unexpected prompts.
- Close background tabs after games or media sessions rather than leaving them active.
- Keep operating-system rotation preferences aligned with your accessibility needs.
- Treat sensor permissions as separate from the coarse Screen Orientation API.
Responsive design without continuous observation
The Screen Orientation API can make a page fit the moment: a landscape game, a portrait reader, or a presentation that stays stable. Its privacy design is strongest when the browser exposes only what the visible document needs, limits background events, and lets platform preferences win.
Noorani follows the same preference for purposeful access. Tracker blocking helps reduce routine cross-site observation, while prayer times, Qibla, Hijri tools, and offline Quran access remain close in a calm desktop browser. A page can adapt to the screen without turning the way you hold a device into a permanent record.
Browse with more intention
Noorani brings prayer times, Qibla, tracker blocking, and privacy into one calm desktop browser built for how Muslims live online.
