The implementation of the library is based on the HTML5 Cross-document messaging postMessage API, Web Workers API, the JSON-RPC protocol and the JSON data format. Pmrpc uses the postMessage API as an underlying communication mechanism and extends it to a RPC model using the JSON-RPC, a transport-independent protocol that uses JSON for formatting messages.
The complete list of features and the full API reference is here.
We have also written several blog posts about Pmrpc and cross-context communication:
and several papers:
- Cross-context Web browser communication with unified communication models and context types
- A Classification Framework for Web Browser Cross-Context Communication
- Inter-widget communication (MUPPLE lecture series)
Cross-context communication systems and libraries
We also maintain a systematized list of other cross-context communication libraries and systems - check it out here.
Below is a hello world example of using pmrpc. For more examples, see the
examples folder. See the API docs for a full description of the API, feature list and usage examples.
Inter-window communication example (parent window invokes procedure in nested iframe):
First, a procedure is registered for remote calls in the iframe that contains the procedure:
Second, the procedure is called from the parent window by specifying the iframe object which contains the remote procedure, name of the procedure and parameters:
Pmrpc should work on Firefox 3+, Google Chrome, Opera 10.60+, Internet Explorer 8+.
Visit the pmrpc testing page to see if your browser can use pmrpc. In general, pmrpc is designed to work with the latest version of all popular browsers, we have no interest or intention to support old browser version (e.g. Firefox 2, IE6).
Projects using pmrpc
Taverna - Workflow construction and execution environment used in many domains, but particularly life sciences.
edudip - Platform for live Online Courses.
Responsive Open Learning Environments - ROLE - European 7th Framework Programme (thanks to Bodo von der Heiden). "ROLE will create an individual world for learning with personalization intelligence on the user's side. ROLE will reach this objective by enabling the user to easily construct and maintain her own personal learning environment (PLE) consisting of a mix of preferred learning tools, learning services, learning resources and other related technologies."
OpenLaszlo - An open source platform for the development and delivery of rich Internet applications.
- Andrew Strelzoff, Jeremy Jones, Aaron Strickland, Justin Wang, Patrick Ransom, Jordan Granville, LaDarius Williams and Eric Mixon for an awesome example of utilizing web workers to speed and smooth physics rendering
- Marc Fawzi for many bug fixes and code improvements
- Jose Badeau for many bug reports and help in debugging several issues