jQuery might be preprocessing the event’s data property, and this operation may not properly support the message event (yet).
Try using the originalEvent property to fetch your data:
$(window).on("message", function(e) {
var data = e.originalEvent.data; // Should work.
});