Detect visionOS Safari to not provide mobile orientation features. Comes up as Ipad.

I was wondering if anyone has managed to figure out a way to properly detect visionOS in Safari ? So I dont include device orientation controls when going fullscreen for my VR player features. It comes up as detecting as Ipad and so has ipad functions it cant do. Its asking for orientation permissions it doesn’t need also.

I've already got transient-pointer XR input controls working.

I’m not sure why they did that other than making life hard for developers I already had to spend days trying to fix my VR Canvas picture in picture hacks and Iphone fullscreen hack as Iphone still doesnt have html fullscreen support for WebGL canvas. those hacks decided to break. desktop safari now needed the canvas video added to dom to get pip working and and now a 100ms delay was needed to get Iphone fullscreen working.

https://github.com/danrossi/canvas-pip-fullscreen

Replies

I figured something out but I presume this may need rectifying in the future. Differentiate Ipad from visionOS using screen dimensions. Ipad is less. I can now have my feature not trying to turn on mobile device orientation controls going fullscreen thinking it's an Ipad / mobile device. Html Fullscreen in visionOS is contained to the browser view until XR immersive mode so orientation won't work. I'm sad so many traps are put in place and makes it very difficult to pull features off for anything Apple.

https://github.com/danrossi/ios-detection-utils/blob/main/src/IOSUtils.js#L30