what's new in webxr support?

Generated on 7/31/2024

1 search

Apple introduced several new features and improvements for WebXR support at WWDC 2024. Here are the key highlights:

  1. Immersive Virtual Reality in Safari on visionOS 2.0:

    • Safari now supports immersive virtual reality experiences built with hardware-accelerated graphics through WebGL. This allows for cross-browser and cross-hardware compatibility with minimal changes. (Build immersive web experiences with WebXR)
  2. User Privacy and Security:

    • WebXR prioritizes user privacy and security. All WebXR content requires HTTPS to prevent man-in-the-middle attacks. Additionally, if WebXR content is embedded in an iframe, the parent page must include the allow="xr-spatial-tracking" attribute to prevent unauthorized VR experiences. (Build immersive web experiences with WebXR)
  3. Session Management:

    • Developers can use the isSessionSupported method to check if an immersive VR session is supported. When requesting a session, developers can specify required and optional features, such as hand tracking. (Build immersive web experiences with WebXR)
  4. Interaction Models:

    • On visionOS, spatial inputs only reveal where the user was looking at the moment of a pinch, ensuring sensitive information is protected. Users can easily exit immersive experiences using system interactions like pressing the crown or using gestures. (Build immersive web experiences with WebXR)
  5. Frame Loop and Reference Space:

    • WebXR sessions provide their own requestAnimationFrame synced to the WebXR display, which is crucial for maintaining high frame rates. Developers can request a reference space to describe the origin of their coordinate system, such as local-floor for standing experiences. (Build immersive web experiences with WebXR)
  6. Integration with Standard Web APIs:

  7. Testing and Debugging:

    • Developers can use the Vision Pro simulator to test WebXR projects, even if they don't own a Vision Pro device. This ensures compatibility with visionOS and new transient pointer inputs. (Build immersive web experiences with WebXR)

For a comprehensive overview, you can refer to the session Build immersive web experiences with WebXR.