So I wanted to see how possible it was to build an Electron app that used a BrowserView to just load the site, giving the impression of a native client without actually needing any specific code on the client. Turns out it’s super easy!
I added a quick notification to test it and see what happens. So this first one is a standard browser notification from Chrome - I sent a new chat message from the native client, and as Chrome was in the background, it fired off a notification. Same sort of behaviour as Ares. No control over Chrome beyond triggering a notification, fair enough, can’t flash Chrome in the taskbar, or highlight the tab.
And then I thought - can I override the Notification behaviour when the JS frontend is loaded through the Electron BrowserView?
Yes.
Yes I can.
Rather than just a pop up notification I can make the taskbar flash as well (which is not standard behaviour). And of course, if I can override notifications when they’re being called through electron, I can do the same for anything else.
The upshot of that is, if I wanted to make a native client for this thing, it could be a single client that would work for every game that ran the system.
(Technical detail of the solution: when the JS frontend code is loaded through the Electron app, it replaces window.Notification with a function that sends an IPC message, so rather than sending an HTML5 Notification it fires off an event. The IPC message is then picked up by the main process of the Electron app and from there we can trigger anything we want, which in this case is just a native notification and the taskbar flash)