I am trying to create a simple application in GJS that sends desktop notifications based on json received via WebSocket. What is the easiest way to use WebSocket in GJS? Thanks in advance. Answer In GJS you’ll probably have to use libsoup for this. The GJS documentation is at https://gjs-docs.gnome.org/soup30, such as the Soup.WebSocketConnection. You’ll probably also want to read
Tag: gjs
How to define setter/getter on prototype
EDIT Oct 2016: Please note this question was asked in 2012. Every month or so someone adds a new answer or comment that refutes an answer, but doesn’t really make sense to do so as the question is probably out of date (remember, it was for Gnome Javascript to write gnome-shell extensions, not browser stuff, which is quite specific). Following