IFC JS does not allow to interact with the created canvas in a new window

Viewed 49

I am working on a functionality to add a canvas created by the IFC.js library to a new window through the window.open method, but at the time of adding said canvas it does not allow me to interact on it.

I am trying to perform the following example found in the documentation:

Example

I have tried to add the canvas to the existing window and it allows me to do it normally, but when I try to add it directly on the new window as shown below it does not re-render it, instead it takes a screenshot of the current state of the canvas which is blank .

  const winHtml = `<!DOCTYPE html>
                        <html>
                            <head>
                                <title>IFC Sample</title>
                            </head>
                            <body>
                             
                            </body>
                        </html>`;

                // Open new window and add the IFC Canvas to it
                const newWindow = window.open("", "IFC Canvas", "_blank");
                const canvasCloned = IFCCanvasContainer.cloneNode(true);
                newWindow.focus();
                newWindow.document.write(winHtml);
                newWindow.document.body.appendChild(canvasCloned);

I have tried to add the canvas to the document and then to the new window but it does not allow me to interact with it.

Could someone help me find a way to interact with the canvas in the new window?

Thank you very much for the help in advance.

All the best

0 Answers
Related