Render HTML static file in IFrame?

It seems like the source property in Iframe is restricted to be a URL and the get request is run from the client side of the session… That being said, I have HTML files I produce automatically on the machine running the gateway server and I would like to render the appropriate file in an IFrame within a appropriate Perspective View.

Not sure if this is possible without digging into the backend of the IFrame component and doing some hacking on my own. I can get access to the file using scripting and am looking for the right way to simply render that static file either in an IFrame or some other method, like an embedded view if necessary/possible.

Any guidance would be greatly appreciated.

May be this help you:
Create a web dev python endpoint and write your script there to generate html and return it to the client. Then use web dev endpoint url in iframe in perspective. You can also use folder endpoint to expose files.
The only cons is you have to pay for web dev module.

IFrames are a general Web concept, not an Ignition/Perspective concept. The only way around the restriction on cross-site origins and local URLs would be hacking the browser, which is probably infeasible.

Entirely within Ignition, the solution is Webdev. However, Webdev is probably overkill for serving already generated static files. You could pretty easily stand up a reverse proxy (nginx, Traefik, etc) ‘in front of’ your actual Ignition gateway, and serve up your static content at a specific path. From the browser’s perspective, everything is coming from the same origin, because your reverse proxy will transparently re-route the requests.

1 Like