How I Used Swift Script in Electron Browser Natively

Electron is a framework for building thick client applications using web technologies like HTML, CSS, and JavaScript. Electron provides flexibility to maintain one JavaScript codebase to create cross-platform apps to support Windows, macOS, and Linux. Basically, you write once and run everywhere.

JavaScript works well with almost all the features one would want in an application, but the problem arises when OS-specific native API interaction is required. One such issue I faced while working on an Electron-based browser. There was a specific requirement to find a list of open application windows on Mac at specific intervals (a few seconds). Node or JavaScript does not provide any interface to access this information from the OS layer, so I have to come up with a custom solution.

CategoriesUncategorized