javascript 如何从浏览器运行桌面应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32273424/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 15:03:35  来源:igfitidea点击:

How to run desktop app from browser?

javascriptbrowser

提问by Gregory Leleytner

I need to launch program from browser(like battlefield when you see dialog with confirmation of starting app). Should I make an extension or there is native way to do it with javascript?

我需要从浏览器启动程序(当你看到确认启动应用程序的对话框时,就像战场一样)。我应该做一个扩展还是有原生的方式用javascript来做?

回答by Gus Zuniga

If the basic idea is to launch a desktop app from the web browser, the firt step is to create a new Registry in Windows and path a URL Custom protocol. And if is you need it you can also send parameters by changing console arguments in your app and append the parameters in your html file.

如果基本思想是从 Web 浏览器启动桌面应用程序,那么第一步是在 Windows 中创建一个新的注册表并路径一个 URL 自定义协议。如果您需要它,您还可以通过更改应用程序中的控制台参数来发送参数,并将参数附加到您的 html 文件中。

You can check here:

你可以在这里查看:

https://weblogs.asp.net/morteza/How-to-run-a-desktop-application-from-a-web-page

https://weblogs.asp.net/morteza/How-to-run-a-desktop-application-from-a-web-page

回答by THE AMAZING

check out: Running .exe from Javascript

查看:从 Javascript 运行 .exe

There are cross-browser compatibility issues with executing a .EXE on a clients machine. i would suggest you look into alternative languages such as Java or even Flash. But it canbe done in Javascript.

在客户端计算机上执行 .EXE 存在跨浏览器兼容性问题。我建议您研究替代语言,例如 Java 甚至 Flash。但它可以在 Javascript 中完成。

-normally i wouldn't answer a question like this, but i saw someone say it's not possible. ANYTHINGis possible.

- 通常我不会回答这样的问题,但我看到有人说这是不可能的。一切皆有可能。