With the showOpenDialog you can open files or folders. To show an open dialog all you need to do is:
the showOpenDialog returns an array of strings with the paths chosen by the user. If you instead decide to use the callback method it will return undefined.
There are more options to showOpenDialog to use. Take a look at the docs to se what the options are.
In the electron-tutorial-app this code is used to display a showOpenDialog. It also uses ipc to communicate between the main and renderer process:
As you can see above some ipc-stuff is used. Take a look at the dialog.js to see how the message is sent and how the response is handled.
I hope you find this post valuable. If you click the ad below I get paid by someone else and can continue to publish posts for free. I would appreciate it very much.