Chapter 8. Further operating system integration and dynamically enabling menu items
This chapter covers
- Showing files in the native operating system’s filesystem manager
- Opening a file in the operating system’s default application for that file type
- Modifying application and context menus dynamically
- Opening the URLs in the default browser instead of the application itself
In addition to creating custom application modules, opening isolated browser window processes, and accessing native file dialogs in Electron, we can use the shell module to interact with the operating system.
How does your application know your system’s default browser for opening websites? If you want to open an image file in its default application, which application should you send it to?
Users of our applications typically set these preferences in the operating system itself. Instead of trying to figure out our user’s settings, we’re better off just asking the operating system for the answer. Electron provides the shell module to make this easy for us.