catch the file when we “open with” file to a electron app

不想你离开。 提交于 2019-12-11 07:18:19

问题


Catch the file when we "open with" file to a electron app

I have created media player in electron and want any media file to play inside my app whenever i right-click and open with my-app, should play the video, which not happening now. Technically, i want to catch the file and play it, whenever its open-with my-app.

I have created media player in electron and want any media file to play inside my app whenever i right-click and open with my-app, should play the video, which not happening now. Technically, i want to catch the file and play it, whenever its open-with my-app.

I hope you guys will help me to find an answer.


回答1:


Use the open-file event on the app object when running on macOS, on windows you need to parse process.argv. See the docs: https://electronjs.org/docs/all#event-open-file-macos



来源:https://stackoverflow.com/questions/48486804/catch-the-file-when-we-open-with-file-to-a-electron-app

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