How to set electron.js default page


down vote
In my Electron app, links to a filename work:

i.e. /folder1/index.html

Links directly to the folder name do not work:

i.e. /folder1

Except for when there is a forward slash at the end:

i.e. /folder1/

When the user clicks on the link to a folder name they get a blank page with no ability to navigate.

tags are being used for the links.

I have read the Electron documentation and searched Stack Overflow looking for a way to set a default page (i.e. index.html) so that the BrowserWindow will attempt to navigate to that when encountering a folder link. I was unable to find a way to do this. It wasn’t exactly clear how to catch an error either.

My Electron app runs on Windows, since that is relevant

The electron version being used is 1.6.11


Provide links just to pages that have content, simply as that.


the link:
should throw out an error 404(not Found), because electron trys to open the file folder1 and not the file folder1/index.html

Electron detects:
/folder1 as file
/folder1/ as folder

I hope it helped