app.setAsDefaultProtocolClient();


#1

Hello i have an assignment that needs to be done tomorrow for my class,
i need to open my app using a link from a browser, and electron does provide some api for that
i added app.setAsDefaultProtocolClient(‘test-app’); to my main.js file, and when i press the link it does work
but how can i get the link it self in my app so i can process it and get information out of it?

Yes, I’m a beginner and i couldn’t find any answer on the web that’s why i asked here.


#2

From the electron documentation:

The whole link, including protocol, will be passed to your application as a parameter.

So, you want to check your parameters on application startup and then process the link.


#3

How can i access the parameters ? i have to idea what to do sorry
can you show me some code that gets the link?


#4

Google is your friend :grinning: I found this by searching for “node process arguments”:

It probably helps to know that Electron is based on Node, so just searching the Electron website might not get you the information you need. But if you search the Electron website and the Node website, you’re much more likely to find the information you seek.


Get running programs name