APIs & Integrations

Michael_Robella
Mitglied

Can't close Action iFrame in CRM Extension

lösung

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 Akzeptierte Lösung
Derek_Gervais
Lösung
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

Can't close Action iFrame in CRM Extension

lösung

Hi @Michael_Robellard,

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

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten
Derek_Gervais
Lösung
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

Can't close Action iFrame in CRM Extension

lösung

Hi @Michael_Robellard,

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

Michael_Robella
Mitglied

Can't close Action iFrame in CRM Extension

lösung

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