ternarylabs / porthole

A proxy to safely communicate to cross-domain iframes in javascript

Home Page:http://ternarylabs.github.com/porthole

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow setting event type when posting a message

codebrew opened this issue · comments

Right now all events being dispatched just have an event type of "message". It would be great if you could optionally control the type when posting a message. This would with creating multiple handlers that just care about specific types of messages.

something like
postMessage(message, [options])

possible options {type: "closeFrame"}

Payload now supports full javascript objects. You can easily add a type attribute and filter against that in your listener.