Web sockets work with chrome packaged apps
So I wondered if it was possible to use html 5 web sockets on chrome apps. I could not find much documentation regarding my question so I decided to try it myself. I cloned the excellent github repository of samples and chose the simplest one (hello world) to test the functionality. Well it works. Here is my repo
To run a packaged app you need to go to tools-> extensions -> load unpacked extensions and navigate to where you have cloned the extension. It will then be available from the new tabs page in the extension categories.
There were a few interesting things I noticed while developing chrome apps.
- You can use external browser libraries like jquery. Although the libraries must be present in the local folder. That is they can not be downloaded from the cdn.
- The html files represent the “windows” all the presentation logic is written in the html markup.
- The app run time is managed by background script. This script is mandatory and must be specified in a manifest file.
- However the dom manipulation can be done by other client side libraries they are included on the html page just like any other web application.
My first experience with chrome apps has been quite positive. It is good to know that they support both Web sockets and web rtc. I wish that in the future it becomes possible to run these apps on mobiles. There is a large subset of applications that could benefit from it. I am planning to experiment with apps on mozilla os as well but there is still a lot to discover in chrome apps.
- On October 13, 2013