APIs & Integrations

Michael_Robella
メンバー

Can't close Action iFrame in CRM Extension

解決

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 いいね!
1件の承認済みベストアンサー
Derek_Gervais
解決策
元HubSpot社員
元HubSpot社員

Can't close Action iFrame in CRM Extension

解決

Hi @Michael_Robellard,

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

元の投稿で解決策を見る

2件の返信
Derek_Gervais
解決策
元HubSpot社員
元HubSpot社員

Can't close Action iFrame in CRM Extension

解決

Hi @Michael_Robellard,

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

Michael_Robella
メンバー

Can't close Action iFrame in CRM Extension

解決

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