简体   繁体   中英

Alternative for java applet which needs to communicate with browser via javascript

In our web application, we using a Java applet to invoke MS.Word application by jacob jar eg Word to open, edit, and when it saves automatically it uploaded to the server.

Google Chrome will no longer support NPAPI, so soon we can not run our applet in Chrome anymore.

So, any suggestions for an alternative for the Java applet. We want to make the same experience for the user, just like before.

We have the same problem. With Webstart is not longer possible to do that communication. We are going to use Websockets between webstart application and browser. Our first attempt is to start a websockets server in the webstart and make browser connect to localhosts. If this is not possible for security limitations in the browsers then we are going to do it through the webserver, browser and webstart application connecting to the webserver and exchanging messages.

I can see 2 distinct possibilities.

  1. Create a standalone application that "wraps" your web application using a technology such as electron . You can then do your browser to desktop integration as you like. This will require an install on the client.
  2. Launch a webstart application (or it could really be any installation that happens on the client). It will need to start a webserver, or connect to a webserver and communicate via http.

I'm saddened by the loss of the Applet. It is a technology not easily replaced. And another methods seem somewhat like 'workarounds'. There is no easy, cross-browser way to break out of the browser sandbox and access the system.

For myself, the loss of the Applet has simply meant that automating some of these processes has become too difficult and it is just better to find an alternative way of achieving a similar end result.

A small note: If you are starting a local webserver, be mindful of security. It can be accessed by other processes on the system. Wouldn't it be fun to open word on anyone's system by sending a request to a port!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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