On Mac you can set a link in a UI control that when clicked will launch with the file:
protocol and launch the registered application.
This works on Mac:
// open page on the file system
var openLocationLink = h("a", {href:""}, "Open");
openLocationLink.setAttribute("href", "file:///Users/user/documents/project/page.html");
// open page in your plugin directory
var folder = await fileSystem.getPluginFolder();
var file = await folder.getEntry("instructions.html");
openLocationLink.setAttribute("href", "file://" + file.nativePath);
// open a folder in Finder
var folder = await fileSystem.getPluginFolder();
openLocationLink.setAttribute("href", "file://" + folder.nativePath);
I haven’t had this work on Windows.
But if the file type isn’t registered you can launch the browser and use that to redirect to a page in your plugin directory to redirect to a registered application types. Apple does this with iTunes for links to podcasts or apps. A window pops up and asks if you want you want to launch the registered link.
There are security concerns sure but they have chosen to install your plugin so there is a level of trust you have granted and in that there is a trust that an application you attempt to open would have to do with your plugin.
There has been discussion around the openExternal in the past and @kerrishotts might have some updated information on this.