Dart in Practice : Native messaging host implementation (Windows-users oriented)
I have not posted for ages, sorry for that, actually I was actively working on my own solo educational project by the name of Cosmos (the name is subject to change), and had the issue working with IndexedDB effectively, so for the past few weeks I've been self-learning Dart, and in turn have written (developed?) a primitive native messaging host (hereinafter as โ NMH) for my Windows platform so I could eventually implement custom modular detached state (data) persisting solution not limiting myself to the clunky in-browser IndexedDB. You can see the tip-of-tree for NMH, it is Windows-users oriented, but just with a few tweaks as described in the specification, could be adjusted for Linux/Mac users respectively.
To encompass the advantage of using NMH over the formerly suggested WebSocket-based implementation, is that NMH has a tendency to maintain Chrome extension's service worker being constantly alive, I could not say the same about the the former implementation, even if followed this recommendation per se. Of course, since Chrome version 120, we can start using chrome.alarms
and expect best effort not to shut the Extension's service worker. The disadvantage that it requires a bit more of the setup especially for Windows users as touching Registry should be your last resort, better never at all, you know what I mean, don't you Win users ? ๐ฃ๐
Cheers ! ๐๐ผ
Subscribe to my newsletter
Read articles from Lukas Gaucas directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Lukas Gaucas
Lukas Gaucas
Self-employed digital nomad at your service Currently working on: CosmosPWA@https://youtube.com/playlist?list=PL7JUsQnnxGCsAJa76T6zVnpnIT5osS9MZ&si=6qlfHepvj0j7vPYM