APIs & Integrations

Michael_Robella
Miembro

Can't close Action iFrame in CRM Extension

resolver

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 Me gusta
1 Soluciones aceptada
Derek_Gervais
Solución
Exmiembro de HubSpot
Exmiembro de HubSpot

Can't close Action iFrame in CRM Extension

resolver

Hi @Michael_Robellard,

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

Ver la solución en mensaje original publicado

2 Respuestas 2
Derek_Gervais
Solución
Exmiembro de HubSpot
Exmiembro de HubSpot

Can't close Action iFrame in CRM Extension

resolver

Hi @Michael_Robellard,

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

Michael_Robella
Miembro

Can't close Action iFrame in CRM Extension

resolver

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