Opening all file types in electron


I am building an application that should be able to open the majority of file types in some way or another. Currently, I am just able to open .txt files using this little function:

`function openF () {
 dialog.showOpenDialog(function (fileNames) {
  if (fileNames === undefined) return;
  var fileName = fileNames[0];
  fs.readFile(fileName, function (err, data) {
    document.getElementById("editor").value = data;
  console.log("We have file path");

But I cannot seem to open any other types of files… Is there a method of loadURL where instead of URL it is load page?
Any suggestions would be greatly appreciated here…