-
-
Notifications
You must be signed in to change notification settings - Fork 398
Closed
Labels
type: bug 🐞Errors in functionalityErrors in functionality
Description
High-level description
When using OpenGL RenderWindow in a iframe (without xr-spatial-tracking feature policy?) get this error on first render:
Uncaught (in promise) DOMException: Failed to execute 'isSessionSupported' on 'XRSystem': Access to the feature "xr" is disallowed by permissions policy.
at vtkOpenGLRenderWindow (webpack-internal:///./node_modules/vtk.js/Sources/Rendering/OpenGL/RenderWindow/index.js:221:75)
Steps to reproduce
Use vtk.js in "sandboxed" iframe
<iframe
id="inlineFrameExample"
title="Inline Frame Example"
width="300"
height="200"
src="./viewer.html"
sandbox="allow-scripts"
>
</iframe>
https://codesandbox.io/s/volume-rendering-bounds-forked-846gd7?file=/index.html:119-304
Expected behavior
No XR related errors unless I opt into trying to activate XR.
Environment
- vtk.js: 25.4
- OS: Linux
- Browser: Chrome 103
Reported here:
Approach?
Looks like xr.isSessionSupported
returns a Promise, so maybe something more like this:
if (navigator.xr) {
navigator.xr
.isSessionSupported('immersive-vr')
.then(isSupported => {
isImmersiveVrSupported = isSupported
})
.catch(error => {
if (error.name !== 'SecurityError') {
throw error
}
})
}
Or remove this feature and lift this to user responsibility. I'm not seeing in repo use of HaveVRDisplay
event.
tbirdso and nigelheap
Metadata
Metadata
Assignees
Labels
type: bug 🐞Errors in functionalityErrors in functionality