ScreenOrientation.unlock
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: mudza100, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Steps to reproduce:
- go into fullscreen mode
- lock the screen
- unlock the screen
- exit from full screen
Actual results:
Getting an "NotSupportedError Operation is not supported" errror every time on unlock even though its was supposed to work on the latest version of firefox after firefox 43
Expected results:
The unlock feature should work and should not always throw the error.
Also reported to MDN to update the docs
https://github.com/mdn/browser-compat-data/issues/15854
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•3 years ago
|
||
Thanks for the bug report, mudza100. Do you have a link to a page that can be used to test this?
Is this bug on Android or on desktop platforms too?
Updated•3 years ago
|
Hii i reproduced it Firefox desktop on Windows 10 and Linux device.
Haven't got the chance to check on Android platforms.
the code that was throwing an error for me is this: as it was mentioned in MDN that firefox desktop supports it.. but throws an error every time on: window.screen.orientation.unlock();
const unlockScreenMode = async () => {
try {
// For android browsers, unlock orientation and exit fullscreen
// For details: https://w3c.github.io/screen-orientation/#unlock-method-unlock-screen-to-default-orientation
if (window.screen?.orientation?.unlock) window.screen.orientation.unlock();
} catch (error) {
console.error('error unlocking:', error);
}
};
Comment 5•3 years ago
|
||
It seems to me that this API is only supported on Android: https://searchfox.org/mozilla-central/rev/ea1234192518e01694a88eac8ff090e4cadf5ca4/dom/base/ScreenOrientation.cpp#334
Perhaps our documentation is incorrect. In any case I'll move this over to the DOM component as they will know better than I do.
Comment 6•3 years ago
|
||
Dup of bug 1763052?
Comment 7•3 years ago
|
||
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #6)
Dup of bug 1763052?
No, actually this API is disabled by default (dom.screenorientation.allow-lock = false
) now. This is dup of bug 1744125.
Updated•3 years ago
|
Description
•