Ky sajt do të funksionojë me kufizime, teksa bëjmë mirëmbajtjen e tij për të përmirësuar punën tuaj. Nëse një artikull nuk e zgjidh problemin tuaj dhe dëshironi të bëni një pyetje, kemi bashkësinë tonë të asistencës, e gatshme për t’ju ndihmuar, te @FirefoxSupport në Twitter dhe/r/firefox në Reddit.

Kërkoni te Asistenca

Shmangni karremëzime gjoja asistence. S’do t’ju kërkojmë kurrë të bëni një thirrje apo të dërgoni tekst te një numër telefoni, apo të na jepni të dhëna personale. Ju lutemi, raportoni veprimtari të dyshimtë duke përdorur mundësinë “Raportoni Abuzim”.

Mësoni Më Tepër

Running executable using UniversalXPConnect

  • 3 përgjigje
  • 1 e ka hasur këtë problem
  • 1 parje
  • Përgjigjja më e re nga cor-el

more options

Hi I am using following javascript to run windows program but I get error message ->typeerror:netscape.security.privilegemanager is undefined. I am running firefox version 31. Is this outdated in latest versions of firefox ? If yes, can you please tell me the alternatives ?

function runApp() {

  var ua = navigator.userAgent.toLowerCase();
               if (ua.indexOf("msie") != -1) {
                   MyObject = new ActiveXObject("WScript.Shell")
                   MyObject.Run(path);
               } else {
                   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                   var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
                   exe.initWithPath(path);
                   var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess);
                   run.init(exe);
                   var parameters = ["/c start winword.exe"];
                   run.run(false, parameters, parameters.length);
               }
           } catch (ex) {
               alert(ex.toString());
           }
Hi I am using following javascript to run windows program but I get error message ->typeerror:netscape.security.privilegemanager is undefined. I am running firefox version 31. Is this outdated in latest versions of firefox ? If yes, can you please tell me the alternatives ? function runApp() { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("msie") != -1) { MyObject = new ActiveXObject("WScript.Shell") MyObject.Run(path); } else { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile); exe.initWithPath(path); var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess); run.init(exe); var parameters = ["/c start winword.exe"]; run.run(false, parameters, parameters.length); } } catch (ex) { alert(ex.toString()); }

Krejt Përgjigjet (3)

more options

Support for UniversalXPConnect has been removed quite some time ago and you can no longer use this method to run privileged code. You would need an extension to run a program.

There are extensions that you can look at.

more options

What do I need to make the following code work? Do I need any adds on for this ?? [Firefox version 31]

//Components.utils.import("resource://gre/modules/FileUtils.jsm");
           //var env = Components.classes["@mozilla.org/process/environment;1"]
           //                    .getService(Components.interfaces.nsIEnvironment);
           //var shell = new FileUtils.File(env.get("COMSPEC"));
           //var args = ["/c", "ping stackoverflow.org"];
           //var process = Components.classes["@mozilla.org/process/util;1"]
           //                        .createInstance(Components.interfaces.nsIProcess);
           //process.init(shell);
           //process.runAsync(args, args.length);
more options

See also:

You need to run such code from within an extension to have the proper chrome privileges.