Chrome Extension with Socket.io

Pretty chuffed got my Chrome extension deployed company wide which now allows us to send notifications to individuals or groups using socket.io - even runs if the browser is not running. The appear as normal system notifications and you can optionally add a URL which is fired when the notification is clicked on.

It’s got load balancing and failover, handles disconnects and will have the ability to queue messages if the user is offline. The popover UI displays the last 10 messages, connection state etc. Its a simple Vue application.

It always been a faff to get other notification systems working like Onesignal because its a company intranet which doesn’t have SSL, ports blocked etc.

Now we have complete control of the whole system.

This has been directly related to my egghead course on using Vue and Socket.io - I guess I need to add the Chrome extension lessons.

1 Like

how’s the extension development process? Was it a pain?

It can be very fiddly.

I didn’t help myself by using the https://github.com/Kocal/vue-web-extension - because though it made the UI of the extension hot reload, the actual UI became hard to debug when running as an extension.

I hit problems when using the chrome.storage.sync.set & get - because they only support callbacks which leads to nesting and most things are event driven.

The lifecycle of the popup UI is not maintained - in my mind I thought it was hiding / showing. Its not, its recreated every-time its displayed.

The ability to have a web page communicate & control the extension is great - the slightly annoying thing is its to a specific extension ID which is different in development compared to the production build.

Finally having Google do the updates once you release can be slightly scary, I guess similar to a phone app, as there is a delay before it’s rolled out.

I still think its worth it - it gives you a lot of power and control.

Just some metrics from the server which is interesting.

I don’t have the baseline for the simple Node app but with 500 connected clients the node app is using approx 60Mb on a windows server. The CPU is idling at 5%, though it was always memory I thought might be an issue.

Speed is impressive - this is a geographic distributed intranet (UK and IE) but even so if we disable the service on the primary and it fails over to the secondary server all 500 clients reconnect by the time I have shut the remote desktop window. So around a second.

I think the next step is to have a central notification service which applications can use to send Email, SMS, Mobile Push Notifications and Desktop Notifications to individual staff. Either individually or by team.