# pull-postmsg [pull-stream][] for bidirectional communication between frames using [window.postMessage][] ```js var Postmsg = require('pull-postsg') ``` ``` var duplex = Postmsg(win, origin) ``` - `duplex`: duplex-stream for communication between `win` and the current window - `win`: window object to post messages to. If not specified, the source window for the first message received on the current window will be used. - `origin`: origin URL or path. defaults to `'*'`. This value is used when [posting messages to `win`](window.postMessage) and is used to filter messages received on the current window. Note that the stream does not propagate backpressure or errors, so if you need those, you have to emulate them at a higher level. [pull-stream]: https://github.com/dominictarr/pull-stream/ [window.postMessage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage ## See also - [mmckegg's window-stream](https://github.com/mmckegg/window-stream) - https://steveliles.github.io/cross_domain_inter_frame_communication_in_javascript.html ## License Copyright (c) 2016 Charles Lehner Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.