Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show system "open with" dialog when clicking file from electron application

In my Electron application I store links to local file paths. Now I would like the user to be able of opening such links using whatever application the operating system is configured for (or the usual "open with" dialog).

Is this possible?

Thanks

like image 823
mdt Avatar asked Nov 07 '22 17:11

mdt


1 Answers

Found a list of possible solutions here:

https://stackoverflow.com/a/33425619/2110299

Of these, the most relevant seems to me the shell module plugin:

https://electron.atom.io/docs/api/shell/

Which provides following API:

shell.openItem(fullPath)

Open the given file in the desktop’s default manner.

Returns Boolean - Whether the item was successfully opened.

like image 150
mdt Avatar answered Nov 26 '22 09:11

mdt