Browser Push

platforms: android
$ cordova plugin add org.threemusketeers.cordova.plugin.browserpush

BrowserPush Cordova Plugin

Event Source and WebSocket are not implemented in the Android browser. This cordova plugin allows the usage of SSE (EventSource) and WebSocket for hybrid application.

For EventSource the implementation should be compliant with the specification



If you use Cordova command line interface :

  • Create an application
cordova create YourApplication
  • Add an Android platform
cd YourApplication
cordova platform add android
  • Add the plugin
// You should be able to do that with plugman but this does not work
// cordova plugin add
// So you will have to clone the BrowserPush plugin
// git clone at $pluginLocation (not inside the project)
cordova plugin add $pluginLocation
  • Bug in some version of the command line interface
cp -f plugins/BrowserPush/www/browserpush.js www/browserpush.js
  • Include a reference to browserpush.js in your index.html located in the www directory after cordova.js
  <script type="text/javascript" src="cordova.js"></script>
  <script type="text/javascript" src="browserpush.js"></script>
  • For a small test, add in your js/index.js an EventSource in the deviceready callback the following:
var source = new EventSource('');
source.addEventListener('message', function(event) {
}, false);

You will connect a test server wich send sever sent event. This will pop an alert like in the following documentation :

  • Build your project
cordova build
  • Start the emulator (You need to have an AVD created)
cordova emulate

Run integration test

Go to itest where you will have an integration test will create a cordova project, launch it in an emulator. The project itself will test the EventSource with tests influenced by


Finish the implementation of Event source

  • Redirection
  • Credentails
  • Test https
  • Test Thread Safety
  • Test Performance

Finish the implementation of WebSocket

  • Only the java part is done
  • Need to continue to work on it to be usable.



  • Initial Version

Give it a trial and send us feedback!

3musket33rs on twitter @3musket33rs

  • Athos is Corinne Krych (@corinnekrych)
  • Aramis is Sebastien Blanc (@sebi2706)
  • Porthos is Fabrice Matrat (@fabricematrat)
  • D'artagnain is Mathieu Bruyen (@mathbruyen)