Skip to content

Conversation

@tbirdso
Copy link
Contributor

@tbirdso tbirdso commented Jul 27, 2023

Removes vtkOpenGLRenderWindow.HaveVRDisplay event. This event is unused internally and was previously left over from WebVR to WebXR integration to avoid API breakage.

Under previous behavior the navigator.xr check was called eagerly at construction, which could result in an unhandled exception. This change removes that eager check so that navigator.xr is referenced only if an XR-related method such as startXR is called.

Applications should query navigator.xr directly to determine whether a given session type may be supported.

Resolves #2537

Also removes outdated WebVR-related TypeScript definitions from vtkOpenGLRenderWindow. Affected method implementations were previously removed in transition from WebVR to WebXR.

Context

navigator.xr is only available where WebXR is supported, and sometimes appears available but is disabled for security. Queries should be limited to instances where XR is explicitly being used, or at least exceptions should be handled otherwise.

Results

Changes

  • Documentation and TypeScript definitions were updated to match those changes

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • Tested environment:
    • vtk.js: master
    • OS: Windows 10
    • Browser: Chrome 115.0.0.0

tbirdso added 2 commits July 27, 2023 11:20
Removes `vtkOpenGLRenderWindow.HaveVRDisplay` event. This event is
unused internally and was previously left over from WebVR to WebXR
integration to avoid API breakage.

Under previous behavior the `navigator.xr` check was called eagerly
at construction, which could result in an unhandled exception. This
change removes that eager check so that `navigator.xr` is referenced
only if an XR-related method such as `startXR` is called.

Applications should query `navigator.xr` directly to determine whether a
given session type may be supported.

Resolves Kitware#2537
Removes outdated WebVR TypeScript definitions from `vtkOpenGLRenderWindow`. Affected definitions
were previously removed during the transition from WebVR to WebXR support.
@tbirdso tbirdso requested review from PaulHax, floryst and jourdain July 27, 2023 15:47
@tbirdso
Copy link
Contributor Author

tbirdso commented Jul 27, 2023

@PaulHax @jourdain Please test and verify whether these changes resolve your reported IFrame issues.

@floryst
Copy link
Contributor

floryst commented Jul 27, 2023

LGTM code-wise.

Copy link
Collaborator

@PaulHax PaulHax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, fix works for the sandbox in the issue!

@tbirdso
Copy link
Contributor Author

tbirdso commented Jul 28, 2023

I see a thumbs up from @jourdain so I believe this closes #2537. Please re-open that issue if problems persist.

@tbirdso tbirdso added this pull request to the merge queue Jul 28, 2023
Merged via the queue into Kitware:master with commit 188c7fb Jul 28, 2023
@github-actions
Copy link

🎉 This PR is included in version 28.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Automated label label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenGL RenderWindow in sandboxed iframe console error

3 participants