Communication between my website and application in electron


Hello everyone and thanks in advance.
Can I load a page online “http:\\displayMeOnElectron” displaying it on electron and put a “do stuff” button that when pressed launches a function to my application in the electron?


Spotify does it, so you might be able to figure out how they do. What’s your use case?


Use the same page that I have in the site that loads the data in its database making local controls on my computer, for example if there is a particular file


Why does the user need to navigate to the page in the browser?


The user does not need to go into the browser, I have the need to use the same web page. To avoid writing it twice.


You don’t have to write a page twice in order to display it in two separate places, because of how computers work. If you have a web app that doesn’t make any assumptions about where it’s running, you can actually drop it into an Electron application whole at build time, because Electron is essentially a browser itself.

You can poke around to see if you can find out how Spotify opens their desktop application to a song you select on their web site. You can also explain your needs in more detail here and potentially receive suggestions.


I have the same need. Reason is simple, I am having electron app because I want some hardware interactions over and above my web app and at the same time, since this app is to be distributed, I want to avoid version maintenance hell. Also, there are some security constraints for which I want the page in my web app interacting with electron app.
Any idea/link on how to do this?