Java applet replacement

Apologies if this has been answered already, but I haven’t been able to find any posts or documentation that appear to address my problem.

I have a Java applet running in a very old version of Firefox that will need to be replaced once we upgrade to the newest version. This applet opens a TCP/IP socket to a daemon running on the local system, which then communicates with a hardware device connected to a serial port. The device sends encrypted data thru the socket which is decrypted by the applet. The applet uses Javascript to update the webpage, and can send and receive real-time data to/from the user which is eventually submitted back to the web server. I haven’t been able to find any technique for accomplishing this same task without using an applet. Any advice on how to achieve this would be greatly appreciated.

If the interaction must involve a webpage you’d probably want to create a WebExtension with a companion native application that communicates with your website.

See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging for info on how to communicate with native applications as an extension.

1 Like

Native companion applications are indeed a good answer to almost any issues involving services not provided by the browser to the addon.

But in your case, if you are able to update your daemon, you may communicate with it from your add-on using HTTP or Websockets instead of pure TCP/IP sockets that are no longer supported natively by extensions.

1 Like

I took a look at the referenced documentation, and it looks like it may work once I convert the applet into a native application. Thank you both very much for the replies.