Search code examples
javagoogle-chromegoogle-chrome-extensionappletnpapi

Alternatives to Java Applet running with NPAPI in Chrome


We have an Applet we used to zip files on the client machine and stream the content back to our servers. Our clients that have updated to the newer versions of Chrome are no longer able to use our Applet because Chrome does not support NPAPI plugins any longer. I think I have a couple of options:

  1. To somehow make the existing Applet work with Chrome (perhaps using JNLP? ) or some other method
  2. To find an alternative technology altogether

The solution has to be able to receive a list of folders, sub-folders and file names. It then has to be able to compress these files, if possible, then upload them to the server. I am open to any suggestions.


Solution

  • You can

    • Read the file(s) with the File API, potentially letting the user add them to your interface via drag and drop (for a more convenient selection mechanism than boring <input type="file"> :-) ).

    • Zip them up in JavaScript using a library like JSZip (though if your server has gzip enabled, I'm not sure you gain a lot doing that; I haven't looked into it deeply, though)

    • Send them to the server either via HTTP POST (possibly multiple posts), or by using XMLHttpRequest2, or via web sockets.

    Of course, your other alternative is to continue to use Java and have the users use Firefox instead of Chrome. Just beware that Mozilla is also looking to make a move away from NPAPI and away from supporting Java. About 20 months ago they weren't:

    there are no plans of dropping support for java or other npapi plugins in firefox other than setting them to "ask to activate": https://blog.mozilla.org/security/2014/02/28/update-on-plugin-activation/

    ....but now:

    Mozilla intends to remove support for most NPAPI plugins in Firefox by the end of 2016. Firefox began this process several years ago...

    (which puts the lie to "no plans" in the first quote)

    ...Websites and publishers which currently use plugins such as Silverlight or Java should accelerate their transition to Web technologies.