Closed Bug 966480 Opened 11 years ago Closed 9 years ago

screen.mozLockOrientation did not work on a Nexus 4 device.


(Firefox for Android Graveyard :: Web Apps (PWAs), defect)

Not set


(Not tracked)



(Reporter: jujjyl, Unassigned)



(Whiteboard: [games])

Steps to reproduce:

1. With a Nexus 4 Android phone running Firefox Nightly, navigate to
2. Rotate the phone to landscape/portrait orientations.

Observed: The browser page orientates freely according to the orientation the device is held in.

Expected: The browser page is locked to landscape-primary orientation and turning the device will not rotate the page.


 - The code follows this source to lock the orientation to landscape-primary orientation.

 - Another Emscripten-based page that exhibits the problem is available at

 - Emscripten currently implements a C -> JS interface to locking orientation, which can be reviewed here:
Whiteboard: [games]
Component: DOM: Core & HTML → Web Apps
Product: Core → Firefox for Android
QA Contact: aaron.train
Version: 29 Branch → unspecified
I have tested my own demo on my Android device and it seems that screen.mozLockOrientation() fails to perform its job.

View this demo in Firefox on Android:

Clicking on “Lock to landscape” executes this code: 


and alerts its return value. Notice how attempting to lock orientation while not in fullscreen mode alerts “false”, which is ok. However, after entering fullscreen mode (via supplied button), and then pressing the “Lock to landscape” button, the return value is “true” but the orientation isn’t locked as rotating the device toggles portrait/landscape as before.
Depends on: 743638
Per bug 1235869, we're going to disable the Android web runtime, so we won't fix this bug in it.

(This is part of a bulk resolution of bugs in the Firefox for Android::Web Apps component, from which I attempted to exclude bugs that are not specific to the runtime, but it's possible that I included one accidentally.  If so, I'm sorry, and please reopen the bug!)
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.