mhkyazd
mhkyazd

Reputation: 285

How can I run a program on the client side with firefox?

i use this script for run application on client side

function RunEXE(prog) {
    var oShell = new ActiveXObject("WScript.Shell");
    oShell.Run('"' + prog + '"', 1);
} 
RunEXE('1.exe'); 

this code worked on IE but in Firefox does not worked for ActiveXObject.

Question what is equivalent of this code for Firefox? or

how can convert this code for firefox?

what is equivalent of ActiveXobject in firefox?

how can user WScript.Shell in firefox?

no matter i can change all permission on client side browser

Upvotes: 0

Views: 335

Answers (1)

Ruan Mendes
Ruan Mendes

Reputation: 92274

My suggestion is that you create an applet and run code like the following:

Runtime.getRuntime().exec("file.exe", null, new File("."));

If you want to be able to pass arguments to the java applet, you'll have to learn about communication between JavaScript and Java in applets. See https://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html

This is totally untested, and you may have to get your applet signed and deal with SecurityManager https://docs.oracle.com/javase/tutorial/essential/environment/security.html

Upvotes: 1

Related Questions