Created attachment 471245 [details] Shows Safari JS api sending 1306px × 735px screen size using https://whatismyviewport.com I checked viewport size and screen size in Safari native VisionOS. On one try the screen size was 1306px × 735px. Looking at my site's analytics I could see that screen size for Intel Mac user agent started appearing Feb 2 when Apple Vision Pro launched. When I reopened safari later the page reported 960px x 540px. What should the expected resolution for screen size be on a device with not much of a logical "screen." Selfishly I'd like it to be something unique to have a way to track growth of Apple Vision Pro users to make web product decisions around
Oh, I guess I can't send the other screenshot showing it at the other resolution.
Created attachment 471246 [details] safari showing JS api for other screen size.
Windows can be resized by the user, so I'm not sure if this is a valid expectation. Even though there is no direct connection between visible window size and pixel dimensions, page rendering will change with the latter.
Alexey, Viewport width and height changes as a user adjusts their window size. I was not reporting an issue with Viewport API. That works as expected. As I change the window size in visionOS Safari, I see the API update values accordingly. The screen width and height of a device normally doesn't change unless maybe the user changes the rendered resolution in system settings, right? It's odd enough that the API would report 1306px × 735px as a screen size for a device that has screens the resolution of 4K TVs,let alone the fact that I'd be able to make the Safari window (and therefore the viewport) larger than the available screen size. Then even odder coming back to the Safari later would have it report out 960px x 540px. I don't know if there's some technical explanation I don't understand for how Apple Vision Pro is rendering everything in view or if it's just intentionally set this way.
<rdar://problem/127776912>