Electron JS - Deep Linking - Example of how to use deep linking

北城余情 提交于 2019-12-23 08:37:13

问题


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.


回答1:


On 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).



来源:https://stackoverflow.com/questions/39292648/electron-js-deep-linking-example-of-how-to-use-deep-linking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!