Invoke program/script from JavaScript using Custom Protocol

58 Views Asked by At

I need the ability to invoke either a compiled program (e.g. C++) or a Script from JavaScript where it will be possible both to pass to and receive from the Program/Script large chunks of data (more specific, a rather long JSON) whose size could exceed hundreds of KBs.

I already have a working Custom Protocol that invokes a Batch File but this option is not suitable since there are limitations to the size of data that can be conveyed to the script and the script can only return an integer value.

So far, I was unable to find any reference that would provide a clear answer to this question. The easiest solution (for me) would be to user a PowerShell script but I saw some posts stating that such script is activated from the cmd and hence would display the same limitations as a Batch script. Also, I infer from those posts that the same might happen if I use a compiled program (i.e. being activated from cmd).

I am seeking suggestions related to the above alternative approaches and, if none of them would work, a different approach that may provide a reliable solution.

NOTE: I'm not asking for code but for a feasible direction to engage into.

EDIT

In my original post I missed one important characteristic of the application I'm developing: It should (as it is now) be able to work WITHOUT the need for any type of Web Server, meaning, when you open the HTML file with a browser (like Google Chrome or MS Edge), the application works as expected. Therefore, any approach that would be based on actions at the server side are not suitable for me.

0

There are 0 best solutions below