Can't close Action iFrame in CRM Extension


#1

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.


#2

Hi @Michael_Robellard,

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


#3

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