In JavaScript, is it possible to detect whether or not a device has the ability to be rotated?
Note: I am not asking how to get the current orientation of the device.
Context: I have to show a "rotate your device" warning if a device is in landscape orientation. But since that is only relevant on devices that can actually be rotated to portrait (usually phones and tablets, but not laptops and desktops), I want to determine if the device can be rotated first. Currently, I check if the device is a mobile device using sniffer.js. But I am curious if there is a better way?