Aaronius / penpal

A promise-based library for securely communicating with iframes via postMessage.
MIT License
381 stars 56 forks source link

Add an optional ID parameter #93

Open sgarfinkel opened 2 months ago

sgarfinkel commented 2 months ago

We have a situation where we would like multiple penpal connections between a parent and child iframe. However because the penpal handshaking protocol assumes that any handshake between the child and parent is the “correct” one, it discards the registered methods in previous handshake calls.

Instead, penpal should have an optional ID parameter that can be used to disambiguate these handshakes so that several connections between parent and child can exist at any given time.