# Cognex Web HMI with iframe

**URL:** <https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [February 17, 2023, 8:33pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030 "2023-02-17T20:33:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Thao](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Peter\_Thao](https://forum.inductiveautomation.com/u/Peter_Thao)\
**Post date:** [February 17, 2023, 8:33pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/1 "2023-02-17T20:33:49Z")

</div>

Has anyone tried to embed Cognex D900 Web HMI into ignition Perspective using iframe?

---

<div class="post-metadata">

**Author:** ![Christian\_Mayne](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/christian_mayne/32/73325_2.png) [@Christian\_Mayne](https://forum.inductiveautomation.com/u/Christian_Mayne)\
**Post date:** [September 5, 2023, 12:57pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/2 "2023-09-05T12:57:17Z")

</div>

Yes, it does not work as Cognex does not allow embedding of the D900. I had a frustrating conversation with a couple of their Application Engineers explaining my need for that feature, however it does not seem like Cognex is too keen on adding it (they cite security issues that _may_ arise).

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 5, 2023, 1:13pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/3 "2023-09-05T13:13:04Z")

</div>

I wonder if you could put Nginx in front of the Cognex web HMI, strip any CSP or X-Frame-Options headers, and add your own that allowed embedding from the Ignition host...

---

<div class="post-metadata">

**Author:** ![Christian\_Mayne](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/christian_mayne/32/73325_2.png) [@Christian\_Mayne](https://forum.inductiveautomation.com/u/Christian_Mayne)\
**Post date:** [September 6, 2023, 12:47pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/4 "2023-09-06T12:47:08Z")

</div>

What is this "dark magic" you speak of? Can you point me towards some documentation on how to go about trying this?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 8, 2023, 11:29am UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/5 "2023-09-08T11:29:35Z")

</div>

Setting up a proxy maybe, ive never really tried it

> **[cors-anywhere](https://www.npmjs.com/package/cors-anywhere)**
>
> CORS Anywhere is a reverse proxy which adds CORS headers to the proxied request. Request URL is taken from the path. Latest version: 0.4.4, last published: 2 years ago. Start using cors-anywhere in your project by running \`npm i cors-anywhere\`. There...

i htink this means you'll also have to run perspective through this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/1/419e12502ce13687e17ee07c4abe060826ba80a1.png)  
so  
`http://ipPRoxy:??/ipgateway/.../view` with the view iframe to` http://ipPRoxy/cognexIP`

---

<div class="post-metadata">

**Author:** ![Peter\_Thao](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Peter\_Thao](https://forum.inductiveautomation.com/u/Peter_Thao)\
**Post date:** [November 20, 2024, 8:03pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/6 "2024-11-20T20:03:06Z")

</div>

I was to get it to work in chrome by install ignore x-frame headers.

---

<div class="post-metadata">

**Author:** ![Christian\_Mayne](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/christian_mayne/32/73325_2.png) [@Christian\_Mayne](https://forum.inductiveautomation.com/u/Christian_Mayne)\
**Post date:** [February 19, 2025, 5:20pm UTC](https://forum.inductiveautomation.com/t/cognex-web-hmi-with-iframe/70030/7 "2025-02-19T17:20:18Z")

</div>

This has now been solved in the D900 series natively with firmware changes on the Cognex side.
