We have an electron crypto app that signs transactions (among other things).
We want other websites to have the ability to have a button that opens that electron app, pre-filled with some params (the transaction information).
flow is:
- user clicks "make transaction" on some-crypto-site.com
- electron app opens up with pre-filled params
- user clicks "sign transaction" in electron app
- electron app does stuff behind the scenes
- electron app closes and sends a message to some-crypto-site.com
This could be done at runtime, or install time.
What I tried (linux, chrome)
calling app.setAsDefaultProtocolClient
with the code of this gist, which is basically:
app.setAsDefaultProtocolClient("my-app")
But after I put my-app://foo?bar=baz
in chrome browser, I get the following popup, and pressing open-xdg does nothing (other than dismissing the popup)
I looked into
- Electron protocol api which seems to handle in-app protocols only
- webtorrent .desktop file This might be the way to go, I'm just not sure how to go about it.
Maybe there's a way to do so at install time through electron builder?
Thanks in advance for the help, I have no idea how to proceed here!
Resources that might be useful
- github repo with mac+window example
- github comment for linux
- github comment for linux 2
- SO answer for all 3 OSs
- SO windows answer
- npm package for windows registery
- SO mac answer
- SO linux answer
- microsoft docs for windows
- windows article
- github comment for windows
- github comment for mac
- info.plst for mac
- old repo for mac and win