Is it possible to send message events between a Jetpack script and the
web page? I have tried the window.postMessage() method as shown below.
The onClick function executes without error, however, the web page
never receives any message events. Can anyone confirm that message
events are permitted, and point out how to do it, and maybe post an
example too?
jetpack.future.import("slideBar");
jetpack.slideBar.append( {
onClick: function(slide) {
var win = jetpack.tabs.focused.contentWindow;
win.top.postMessage("message1","
example.com");
win.top.postMessage("message2","*");
console.log("Sent test messages");
}
});