Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

Event rule based window message?

Avatar

Level 4

Is there an event configuration where my rule would trigger on the equivalent of window.addEventListener("message" ...) ? Then even more vexxing is can I then create rule conditions filtering on the values in event.origin and event.data? Based on what I see - I think the answer is no.

 

Use case is I have an iframe using postMessage to let the parent window know something happened.

 

I suspect I will need to create my own listener. Then let that listener do the appropriate filtering and validation and then based on the payload fire the appropriate direct calls.

2 Replies

Avatar

Level 10

You may want to use Custom Event to get the rule triggered.

 

Avatar

Level 4
I don't think Custom Event will work. The event is fired onto the window object. And the custom event rule seems to be element focuses. But I do see "Custom Code" in which case I could add my window.addEventListener("message". function(){if(checkPasses) trigger()})