// https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
const screenlock = module.exports = (o => {
let orientation = typeof screen === 'object'
&& (screen.orientation ||
screen.mozOrientation ||
screen.msOrientation);
return {
lock : (type='landscape-primary') => {
if (orientation && orientation.lock) {
try {
orientation.lock(type);
} catch (e) {}
}
},
unlock : () => {
if (orientation && orientation.unlock) {
try {
orientation.unlock();
} catch (e) {}
}
}
};
})({});
iambumblehead/screenlock
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
try screenlock.lock and screenlock.unlock without errors
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published