The corresponding event must be of type DeviceOrientationEvent and must fire on the window object: