Communication between my website and application in electron


#1

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


#2

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


#3

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


#4

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


#5

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.


#6

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.


#7

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?