by @bordignon October 2013
You can do what you want with the code as long as you provide attribution back to me and don’t hold me liable!
This is an example of using the MQTT javascript library, websockets and chrome extensions.
This extension will connect to a MQTT broker using websockets and then subscribe to a topic. When a message is received it will then display the notification using chrome's built-in notifications function.
Requires "notifications" permission.
Screenshot of what the notification looks like. (Note: the messagebox in bottom right and also the connection icon near the address bar, this will change color if the connection is lost.)
##Installation;
- download all the files to a directory.
- edit the background.js file and change the three variables broker, broker port and topic
- in chrome, goto tools -> extenstions
- tick the 'developer mode' box, then click 'load unpacked extension'
- select the directory where you have download and edited the extension
- it should automatically connect!
Screenshot shows where the options are to install the extension in developer mode.