Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time


Pmrpc is an HTML5 JavaScript library for message passing, remote procedure call and publish-subscribe cross-contex communication in the browser. The library provides a simple API for exposing and calling procedures between browser windows, iframes and web workers, even between different origins. Pmrpc also provides several advanced features: callbacks similar to AJAX calls, ACL-based access control, asynchronous procedure support and fault-tolerance via retries. In case this wasn't clear, pmrpc is not a library for browser-server communication, it is a library for communication within the browser.

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 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:

    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
      // expose a procedure
      pmrpc.register( {
        publicProcedureName : "HelloPMRPC",
        procedure : function(printParam) { alert(printParam); } }

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:

    <script type="text/javascript" src=""></script>
    <iframe id="ifr" name="ifr" src="iframe.html" width="0" height="0" frameborder=0></iframe>
    <script type="text/javascript">
      // call the exposed procedure {
        destination : window.frames["ifr"],
        publicProcedureName : "HelloPMRPC",
        params : ["Hello World!"] } );

Browser support

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).


Pmrpc was developed by Ivan Zuzak and Marko Ivankovic and is available under the Apache v2.0 license.

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.


gaugestracking alpha


HTML5 inter-window and Web workers RPC and publish-subscribe communication library







No packages published