# Chatflow embedded through iframe

**URL:** <https://community.hubspot.com/t/chatflow-embedded-through-iframe/41415>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, professional\
**Created:** [July 28, 2021, 12:32pm UTC](https://community.hubspot.com/t/chatflow-embedded-through-iframe/41415 "2021-07-28T12:32:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [August 5, 2021, 5:13pm UTC](https://community.hubspot.com/t/chatflow-embedded-through-iframe/41415/4 "2021-08-05T17:13:40Z")

</div>

You can run this js @SAncliff -

```lia-code-sample
let resolved = 0;
window.addEventListener('message', event => {
 let d = (typeof event.data === typeof "") ? JSON.parse(event.data) : event.data;
 if(d.type === 'request-widget' && void 0 !== d.uuid && !resolved) {
 resolved = 1;
 $('#hs_cos_wrapper_widget_1627561115672 iframe').attr('src', $('#hubspot-messages-iframe-container iframe').attr('src'));
 }
});

```

Of course, I hard coded your module id into that script so it would be better to add a class to your target iframe and use that instead, but just dropping this code into the header of your site should work for now.

---

_[View the full topic](https://community.hubspot.com/t/chatflow-embedded-through-iframe/41415)._
