简体   繁体   English

Java Applet使用Chrome浏览器启动客户端程序有哪些替代方案?

[英]What is the alternatives for Java Applet to launch client programs using Chrome browsers?

I am working in a web application using ASP.net and C#. 我正在使用ASP.net和C#在Web应用程序中工作。

My target is to check on a desktop application on the client machine .. If it was exist then I should launch it. 我的目标是检查客户端计算机上的桌面应用程序。如果它存在,那么我应该启动它。 Else if it wasn't exist, we should download, install and then launch it. 否则,如果它不存在,我们应该下载,安装然后启动它。

I could develop this module using Java Applet but unfortunately, Google decided to disable NPAPI in September 2015, So the applet will not working on Chrome. 我可以使用Java Applet开发这个模块但不幸的是,谷歌决定在2015年9月禁用NPAPI,因此applet将无法在Chrome上运行。

My question is about the Applet alternatives to help me implementing the above scenario ? 我的问题是关于帮助我实现上述场景的Applet替代方案?

Once Google Chrome was the first to announce that they won't be supporting NPAPI anymore, they were also the first to provide a new architecture in order to rewrite your code to work on their browser. 一旦Google Chrome成为第一个宣布他们不再支持NPAPI的人,他们也是第一个提供新架构以便重写代码以在其浏览器上工作的人。 You can take a look on Native Messaging, which “can exchange messages with native applications using an API that is similar to the other message passing APIs”. 您可以查看Native Messaging,它“可以使用与其他消息传递API类似的API与本机应用程序交换消息”。 The problem is that this approach only works on Chrome, is not something that you can adapt to other browsers. 问题是这种方法只适用于Chrome,不能适应其他浏览器。

A more useful approach is FireBreath, a browser plugin in a post NPAPI world. 一个更有用的方法是FireBreath,一个后NPAPI世界中的浏览器插件。 Check the words below from one buddy of the project: 检查项目的一个伙伴下面的单词:

“FireBreath 2 will allow you to write a plugin that works in NPAPI, ActiveX, or through Native Messaging; “FireBreath 2将允许您编写一个在NPAPI,ActiveX或Native Messaging中工作的插件; it's getting close to ready to go into beta. 它已接近准备进入测试阶段。 It doesn't have any kind of real drawing support, but would work for what you describe. 它没有任何真正的绘图支持,但可以适用于您描述的内容。 The install process is a bit of a pain, but it works. 安装过程有点痛苦,但它确实有效。 The FireWyrm protocol that the native messaging component uses could be used with any connection that allows passing text data; 本机消息传递组件使用的FireWyrm协议可以与允许传递文本数据的任何连接一起使用; it should be possible to make it work with js-ctypes on firefox or plausibly WEB-RTC or even CORS AJAX in some way. 应该可以在firefox上使用js-ctypes,或者以某种方式使用WEB-RTC甚至CORS AJAX。 For now the only thing we needed to solve was Chrome, but we did it in a way that should be pretty portable to other technologies.” 目前我们唯一需要解决的问题是Chrome,但我们采用的方式对其他技术来说非常便携。“

The only (semi) viable option as far as I can see, is to offer the Chrome user a link to a JNLP file for a desktop application. 据我所知,唯一(半)可行的选项是为Chrome用户提供指向桌面应用程序的JNLP文件的链接。 Then when/if the JWS desktop application starts, have it report back to the server 'loaded OK' and then 'target app. 然后当/如果JWS桌面应用程序启动时,让它报告回服务器'加载确定'然后'目标应用程序。 installed/not installed'. 安装/未安装'。

On your server, have a time out for waiting on the client to report back. 在您的服务器上,有一个等待客户端报告的时间。 If it passes that time, presume the client machine does not support Java at all and the user is checking some web service to try and figure out what app. 如果它通过那个时间,假定客户端机器根本不支持Java,并且用户正在检查某些Web服务以尝试找出哪个应用程序。 opens a JNLP! 打开JNLP!

After searching about the most suitable way to achieve my goal, I think using custom protocols will be a nice solution to access my client applications from the web page. 在搜索了最合适的方法来实现我的目标之后,我认为使用自定义协议将是从网页访问我的客户端应用程序的一个很好的解决方案。

This solution is used by many companies such as Microsoft (using mailto: to open Outlook application) and Apple (using itms: to open iTunes application) . 许多公司使用此解决方案,例如Microsoft(使用mailto:打开Outlook应用程序)Apple(使用itms:打开iTunes应用程序)

The following link is a very good link which talk about a custom protocols: https://support.shotgunsoftware.com/entries/86754-How-to-launch-external-applications-using-custom-protocols-rock-instead-of-http- 以下链接是一个非常好的链接,谈论自定义协议: https//support.shotgunsoftware.com/entries/86754-How-to-launch-external-applications-using-custom-protocols-rock-instead-of -http-

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

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