Disable browsers from access to electron / express application


#1

I have an express server that serves my angular front end at http://localhost:9000

I’m using electron as a desktop client.

I want to force users to view the application through electron and only through electron. I don’t want users to have the ability to browser the application through any other browser.

Is there any way to disable the ability to access the app through a regular browser?

I’ve attempted to find information regarding this but have come up short.


#2

solution

 if (window.process && window.process !== undefined) { 
       // Likely electron 
    }

#3

Can you explain how that solves anything?


#4

Yeah, so with that I’m able to check whether the client is an ‘electron type’ client or a typical browser. From there I can do whatever I need to if it’s not an electron client (redirect, welcome state etc…)