My goal is to develop a website and desktop application using the same code base. However, due to some minor differences between the two platforms, I need a way for my Angular app to distinguish whether it has been called from the web or from Electron.
I've attempted several approaches in my main.js file:
Firstly, I tried adding a URL parameter in the loadFile
function like this:
win.loadFile('dist/project/index.html?electron=true')
Unfortunately, this approach resulted in the file not being found.
Next, I created a separate 'index.html
' specifically for Electron:
win.loadFile('dist/project/electron.html')
However, Angular does not compile this HTML file as expected.