I was thinking about native messaging at first, but it requires quite a bit of work and has some limitations:
1. The application's location can't be changed.
2. The application uninstallation becomes a lot harder, because for example on Windows it will have to undo certain registry changes for a clean uninstall.
3. The application will have to detect which browser the user uses, and install the native messaging manifest in the correct location. The installation process for an application to be reachable via native messaging is not the same for all browsers.
What I am currently doing is building a WebExtension with TypeScript, which is listening in on the CG IDE's events, and sending the appropriate events to the ide. These are the same as the ones used in the
js/content.js file in the CG Sync extension.
For the file-watching, I am probably going to write a JavaFX app that spins up a little websocket server. The WebExtension can then connect to this websocket server, and there can be two-way communication between the application and the extension. The little downside is that you got a websocket server running in the background, which takes a bit of RAM, but since RAM is quite cheap nowadays I don't think it's going to be a problem.
I initially was thinking about making the application in Electron (which is basically JS for desktop applications), but to be able to have fluent auto-updating in an Electron app, you'll have to pay quite a bit of money to sign the application on all platforms. Since I want it to be a free application, I dropped that choice and am probably going with Java now, because there is a library that supports easy auto-updating (without needing to sign the application) here. This would allow me to simply put some files up on my personal website, after which auto-updating will be smooth and easy for all platforms, which is quite important.
Furthermore, while the CG Sync extension could be reused, I prefer to completely re-do it since the communication with the application will be completely different, and CG Sync's coding style does not go well with my current preference. On top of that, I somewhat prefer to do it in TypeScript because it gives better auto-completion, and because I used it in a previous WebExtension aswell so I already had the building process laying around.
Development on the extension is going quite well, and since this is my main hobby project at the moment I am quite confident it can be done before 2018 hits.