mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
22 lines
598 B
JavaScript
22 lines
598 B
JavaScript
|
function specialPowersLock(orientation) {
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
SpecialPowers.pushPrefEnv({
|
||
|
'set': [ ["dom.screenorientation.testing.non_fullscreen_lock_allow", true] ]
|
||
|
}, function() {
|
||
|
var p = screen.orientation.lock(orientation);
|
||
|
resolve(p);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function specialPowersUnlock() {
|
||
|
return new Promise(function(resolve, reject) {
|
||
|
SpecialPowers.pushPrefEnv({
|
||
|
'set': [ ["dom.screenorientation.testing.non_fullscreen_lock_allow", true] ]
|
||
|
}, function() {
|
||
|
screen.orientation.unlock();
|
||
|
resolve();
|
||
|
});
|
||
|
});
|
||
|
}
|