Kitware / itk-vtk-viewer

2D / 3D web image, mesh, and point set viewer using itk-wasm and vtk.js
https://kitware.github.io/itk-vtk-viewer/
BSD 3-Clause "New" or "Revised" License
209 stars 63 forks source link

Including the viewer inside an Iframe #655

Open kerautret opened 1 year ago

kerautret commented 1 year ago

Hi Kitware dev team! If I am not wrong, it is not possible to include the itkVtkViewer inside an iFrame ? I know that the embedding is a better way but in the IPOL framework we see some issue to include the viewer inside the online demo system. (some error like Refused to load blob:with reference to something like worker-src directive of the Content Security Policy. promiseEmptyOnRejected — itkVtkViewerCDN.js:16:268570 if you see where it can comes from).

We were successfully used the viewer that is really excellent from our previous online demonstration but we were planning to extend it on the new system witch will be more safe for a longer visibility in longer term. (I tried to include the viewer on this ipol online demo

thewtex commented 1 year ago

Hi @kerautret !

It should -- we use the viewer in a iframe in itkwidgets.

The ipol demo is awesome!! Is this using the latest version of the viewer?

kerautret commented 1 year ago

Hi @thewtex ! Thanks! In fact I was testing the iFrame with the doc url with here: https://kitware.github.io/itk-vtk-viewer/app/?fileToLoad=https://data.kitware.com/api/v1/file/564a65d58d777f7522dbfb61/download/data.nrrd as given in the official page and is was not working in my basic test page: https://ipol-geometry.loria.fr/Sites/testIFrame.html

However I remember from your remark of version I tested on the viewer app from our server and I tested it works: Capture d’écran 2023-03-01 à 21 21 04 So I am confident to make working on the online demonstration of new system (just not direct to test because there are rewriting url script to update) I will test of the base work it could perfect. Perhaps it could be good to update the version on the doc page since perhaps other people can think that iframe did not work ?

kerautret commented 1 year ago

So nice it works ;) 🎉 Thanks for the help and iframe orient, excellent it will be easy now to use in online demo as a standard in IPOL !

Capture d’écran 2023-03-01 à 21 50 38

thewtex commented 1 year ago

@kerautret fantastic!!

I am not sure which doc page you were looking at, but a PR would be appreciated: https://github.com/Kitware/itk-vtk-viewer/tree/master/doc/content/docs