APIs & Integrations

Michael_Robella
Member

Can't close Action iFrame in CRM Extension

SOLVE

In my Javascript for handling the action in my iframe opened by the IFRAME action I cannot get the modal to close.

I have tried the following:

window.postMessage({"action": "DONE"}, "*");  //Does Nothing
window.parent.postMessage({"action": "DONE"}, "*"); //Does Nothing
window.postMessage({"action": "DONE"}, window.parent); //Throws a CORS Exception
window.parent.postMessage({"action": "DONE"}, window.parent); //Throws a CORS Exception
window.parent.postMessage({"action": "DONE"}, window); //Throws an invalid Window Exception

Trying to get this to work on the latest Chrome Version 63.0.3239.108 (Official Build) (64-bit)

Pretty Sure I am just passing the wrong arguments. Please let me know the right arguments and also please update the documentation for others with more detail.

0 Upvotes
1 Accepted solution
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Can't close Action iFrame in CRM Extension

SOLVE

Hi @Michael_Robellard,

Can you give this a try: window.parent.postMessage(JSON.stringify({"action": "DONE"}), "*");

View solution in original post

0 Upvotes
2 Replies 2
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Can't close Action iFrame in CRM Extension

SOLVE

Hi @Michael_Robellard,

Can you give this a try: window.parent.postMessage(JSON.stringify({"action": "DONE"}), "*");

0 Upvotes
Michael_Robella
Member

Can't close Action iFrame in CRM Extension

SOLVE

That fixed it, can you please update the documentation in case any one else runs into this problem