admin管理员组文章数量:1389979
In Electron JS, I created an app for Windows and registered my own protocol for deep linking. The app properly opens when clicking on my link ludo://play?level=1234
. No problem there. However I don't know how to retrieve the deep link inside of my app. The docs for app.setAsDefaultProtocolClient mention this sentence:
The whole link, including protocol, will be passed to your application as a parameter.
Can anyone tell me how to retrieve that? Because it is not in process.argv
nor is it in process.execPath
or process.execArgv
.
Could it be passed in a callback when the app starts? Any help on this would be great.
In Electron JS, I created an app for Windows and registered my own protocol for deep linking. The app properly opens when clicking on my link ludo://play?level=1234
. No problem there. However I don't know how to retrieve the deep link inside of my app. The docs for app.setAsDefaultProtocolClient mention this sentence:
The whole link, including protocol, will be passed to your application as a parameter.
Can anyone tell me how to retrieve that? Because it is not in process.argv
nor is it in process.execPath
or process.execArgv
.
Could it be passed in a callback when the app starts? Any help on this would be great.
Share Improve this question asked Sep 2, 2016 at 12:37 Martin DrapeauMartin Drapeau 1,53415 silver badges17 bronze badges 2- Take a look at my answer in another SO question: Pass URL scheme in a Single Instance Electron Application for Windows. – oikonomopo Commented May 8, 2017 at 8:30
- 1 Anyone did it for ubuntu electon app? i have successfully done it for windows and mac – ninja dev Commented Feb 2, 2018 at 5:24
1 Answer
Reset to default 6On macOS you need to listen to the app.open-url
event, while on Windows the url should be available in process.argv
(in the main process).
本文标签: javascriptElectron JSDeep LinkingExample of how to use deep linkingStack Overflow
版权声明:本文标题:javascript - Electron JS - Deep Linking - Example of how to use deep linking - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744664373a2618440.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论