简体   繁体   English

url 方案:根据要求打开 Windows 应用程序 [Electron]

[英]url scheme: open windows application on request [Electron]

i have a php website and i have an electron based desktop application i want to be able to open this application which i made it when the client hit the button on my website, how can i do that?我有一个 php 网站,我有一个基于电子的桌面应用程序,我希望能够打开这个应用程序,当客户端点击我网站上的按钮时,我该怎么做?

for example, let's say i have a chatting website and a chatting application and the user likes to use the app instead of the website so after he installs my app on his windows machine and then go to the website to click the button i want the app to open it self!例如,假设我有一个聊天网站和一个聊天应用程序,并且用户喜欢使用该应用程序而不是网站,因此在他在他的 Windows 机器上安装我的应用程序然后转到该网站单击我想要该应用程序的按钮后自己打开吧! how can i achieve that please ?我怎样才能做到这一点?

Electron 专门为此提供了app.setAsDefaultProtocolClient API。

What you are attempting is really hard. 你在尝试的真的很难。 Most browsers operate inside a sandbox, meaning that the website code (javascript) cannot do anything outside the browser. 大多数浏览器都在沙盒中运行,这意味着网站代码(javascript)无法在浏览器之外执行任何操作。 You would have to build something like a browser extension to make it work. 您必须构建类似浏览器扩展的东西才能使其正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM