Mozilla Javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Will

    #1

    Mozilla Javascript

    Hi,
    I am looking for a way to start a trusted Linux application (a C executable)
    on my local machine, upon clicking a link. Basically the equivalent of
    the ActiveXObject in IE. Thank you.
    Will
  • Ivan Marsh

    #2
    Re: Mozilla Javascript

    On Wed, 09 Jun 2004 10:45:20 -0700, Will wrote:
    [color=blue]
    > Hi,
    > I am looking for a way to start a trusted Linux application (a C
    > executable) on my local machine, upon clicking a link. Basically the
    > equivalent of the ActiveXObject in IE. Thank you. Will[/color]

    Why you won't find that in Mozilla:

    Computerworld covers a range of technology topics, with a focus on these core areas of IT: generative AI, Windows, mobile, Apple/enterprise, office suites, productivity software, and collaboration software, as well as relevant information about companies such as Microsoft, Apple, and Google.


    --
    i.m.
    The USA Patriot Act is the most unpatriotic act in American history.

    Comment

    • Martin Honnen

      #3
      Re: Mozilla Javascript



      Will wrote:

      [color=blue]
      > I am looking for a way to start a trusted Linux application (a C executable)
      > on my local machine, upon clicking a link. Basically the equivalent of
      > the ActiveXObject in IE.[/color]

      Well if a link in a HTML document loaded from a HTTP server could simply
      start local applications browsers would have big security holes.
      Mozilla has some XPCOM mechanism to start a process, see

      but unless you run your pages from chrome or sign your script you
      shouldn't be able to use that mechanism.
      If your HTML page with the script is loaded from file: URL you can
      request the privilege to use XPConnect (XPCOM via JavaScript), here is
      an example tried successfully on Windows to run notepad.exe:

      netscape.securi ty.PrivilegeMan ager.enablePriv ilege('Universa lXPConnect');
      var process =
      Components.clas ses["@mozilla.o rg/process/util;1"].createInstance (Components.int erfaces.nsIProc ess);
      var file =
      Components.clas ses["@mozilla.o rg/file/local;1"].createInstance (Components.int erfaces.nsILoca lFile);
      file.initWithPa th("C:\\Windows \\notepad.exe") ;
      process.init(fi le);
      process.run(fal se, [""], 1);

      thus I guess if you pass the right LINUX path to an executable to
      initWithPath that example should work as well. Please report back to the
      JavaScript group if it does

      --

      Martin Honnen
      http://JavaScript.FAQTs.com/

      Comment

      • Will

        #4
        Re: Mozilla Javascript

        Martin Honnen <mahotrash@yaho o.de> wrote in message news:<40c86241$ 1@olaf.komtel.n et>...[color=blue]
        > Will wrote:
        >
        >[color=green]
        > > I am looking for a way to start a trusted Linux application (a C executable)
        > > on my local machine, upon clicking a link. Basically the equivalent of
        > > the ActiveXObject in IE.[/color]
        >
        > Well if a link in a HTML document loaded from a HTTP server could simply
        > start local applications browsers would have big security holes.
        > Mozilla has some XPCOM mechanism to start a process, see
        > http://groups.google.com/groups?q=ns...lla.org&rnum=2
        > but unless you run your pages from chrome or sign your script you
        > shouldn't be able to use that mechanism.
        > If your HTML page with the script is loaded from file: URL you can
        > request the privilege to use XPConnect (XPCOM via JavaScript), here is
        > an example tried successfully on Windows to run notepad.exe:
        >
        > netscape.securi ty.PrivilegeMan ager.enablePriv ilege('Universa lXPConnect');
        > var process =
        > Components.clas ses["@mozilla.o rg/process/util;1"].createInstance (Components.int erfaces.nsIProc ess);
        > var file =
        > Components.clas ses["@mozilla.o rg/file/local;1"].createInstance (Components.int erfaces.nsILoca lFile);
        > file.initWithPa th("C:\\Windows \\notepad.exe") ;
        > process.init(fi le);
        > process.run(fal se, [""], 1);
        >
        > thus I guess if you pass the right LINUX path to an executable to
        > initWithPath that example should work as well. Please report back to the
        > JavaScript group if it does[/color]

        This works if the HTML file is invoked as file:. Thank you.
        Will

        Comment

        Working...